-
-
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.
Disable scope hoisting when 'this' points to an export (#9291)
* recognize 'this' as a potential keyword linking to an export * Add co-authors. Co-authored-by: Eric Eldredge <lettertwo@gmail.com> Co-authored-by: Brian Tedder <btedder@atlassian.com> * update BailoutReason text, fix test name * rename "thises" to "this_exprs" * remove print statements * cleanup * don't wrap when `this` collides in class * move bailouts outside of tracing * add integration test * cleanup integration test * update test: move to commonjs and change search * update naming * Update packages/core/integration-tests/test/scope-hoisting.js Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> * move fixture for test into commonjs folder * update link for THisInExport bailout reason * remove duplicate memberProp check * Revert "remove duplicate memberProp check" This reverts commit a017082. * store Ident, Span instead of entire node * move instead of clone self.this_exprs * Cleanup --------- Co-authored-by: achan3 <achan3@atlassian.com> Co-authored-by: Brian Tedder <btedder@atlassian.com> Co-authored-by: Brian Tedder <6571474+imbrian@users.noreply.github.com> Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
- Loading branch information
1 parent
0e23584
commit 84b9609
Showing
5 changed files
with
125 additions
and
1 deletion.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
packages/core/integration-tests/test/integration/scope-hoisting/commonjs/exports-this/a.js
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,11 @@ | ||
exports.foo = function() { | ||
exports.bar() | ||
} | ||
|
||
exports.bar = function() { | ||
this.baz() | ||
} | ||
|
||
exports.baz = function() { | ||
return 2 | ||
} |
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
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