-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore require if it is defined (#975)
- Loading branch information
1 parent
74438d4
commit 12b649b
Showing
3 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const test = { | ||
unaryFnExpr: 'test failed', | ||
fnExpr: 'test failed', | ||
fnDecl: 'test failed', | ||
varDecl: 'test failed', | ||
topVarDecl: 'test failed' | ||
}; | ||
|
||
module.exports.test = test; | ||
|
||
function main(require) { | ||
require('test passed'); | ||
} | ||
|
||
main(x => test.fnDecl = x); | ||
|
||
(function(require) { | ||
require('test passed') | ||
})(x => test.fnExpr = x); | ||
|
||
void function main(require) { | ||
require('test passed'); | ||
}(x => test.unaryFnExpr = x); | ||
|
||
void function main() { | ||
const require = x => test.varDecl = x | ||
|
||
require('test passed') | ||
}() | ||
|
||
function require(x) { | ||
return test.topVarDecl = x; | ||
} | ||
|
||
require('test passed') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters