Skip to content

Commit

Permalink
Use pull request foundation#10990 from DanielRuf/fix/get-fn-name-unit…
Browse files Browse the repository at this point in the history
…-test for v6.5.0

406cb1b fix: do not test for inferred names in getFnName unit test
5071568 fix small typo
afec54b add info about inferred names of anonymous functions

Signed-off-by: Nicolas Coden <nicolas@ncoden.fr>
  • Loading branch information
DanielRuf authored and ncoden committed Jun 16, 2018
1 parent 2672a04 commit c6182a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/javascript/util/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,11 @@ describe('Foundation core', function() {
name.should.be.equal('A');
});

it('should handle a function expression', function() {
var B = function(){};
var name = Foundation.getFnName(B);
it('should handle an anonymous function expression', function() {
var name = Foundation.getFnName(function(){});

// Inferred names (i.e. `var name = function() {}`) are not tested as they are widely supported
// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#Inferred_function_names
name.should.be.a('string');
name.should.be.equal('');
});
Expand Down

0 comments on commit c6182a2

Please sign in to comment.