-
-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(commonjs): add heuristic to deoptimize requires after calling imp…
…orted function (requires [email protected]) (#1038) BREAKING CHANGES: Requires at least [email protected]
- Loading branch information
1 parent
7434b0f
commit c583aaf
Showing
23 changed files
with
660 additions
and
180 deletions.
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
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
1 change: 0 additions & 1 deletion
1
packages/commonjs/test/fixtures/form/unambiguous-with-default-export/output.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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import * as commonjsHelpers from "_commonjsHelpers.js"; | ||
import { __exports as input } from "\u0000fixtures/form/unambiguous-with-default-export/input.js?commonjs-exports" | ||
import "\u0000CWD/fixtures/form/unambiguous-with-default-export/foo.js?commonjs-proxy"; | ||
|
||
export default {}; |
1 change: 0 additions & 1 deletion
1
packages/commonjs/test/fixtures/form/unambiguous-with-import/output.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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import * as commonjsHelpers from "_commonjsHelpers.js"; | ||
import { __exports as input } from "\u0000fixtures/form/unambiguous-with-import/input.js?commonjs-exports" | ||
import "\u0000CWD/fixtures/form/unambiguous-with-import/foo.js?commonjs-proxy"; | ||
|
||
import './bar.js'; |
1 change: 0 additions & 1 deletion
1
packages/commonjs/test/fixtures/form/unambiguous-with-named-export/output.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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import * as commonjsHelpers from "_commonjsHelpers.js"; | ||
import { __exports as input } from "\u0000fixtures/form/unambiguous-with-named-export/input.js?commonjs-exports" | ||
import "\u0000CWD/fixtures/form/unambiguous-with-named-export/foo.js?commonjs-proxy"; | ||
|
||
export {}; |
4 changes: 4 additions & 0 deletions
4
packages/commonjs/test/fixtures/function/call-non-local-function-semantics/_config.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,4 @@ | ||
module.exports = { | ||
description: | ||
'uses strict require semantics for all modules that are required after an imported function is called' | ||
}; |
1 change: 1 addition & 0 deletions
1
packages/commonjs/test/fixtures/function/call-non-local-function-semantics/browser.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 @@ | ||
module.exports = 'browser'; |
7 changes: 7 additions & 0 deletions
7
packages/commonjs/test/fixtures/function/call-non-local-function-semantics/main.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,7 @@ | ||
// simplified from dd-trace | ||
const platform = require('./platform'); | ||
const browser = require('./browser'); | ||
|
||
platform.use(browser); | ||
|
||
require('./proxy'); |
1 change: 1 addition & 0 deletions
1
packages/commonjs/test/fixtures/function/call-non-local-function-semantics/platform.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 @@ | ||
exports.use = (platform) => (exports.platform = platform); |
3 changes: 3 additions & 0 deletions
3
packages/commonjs/test/fixtures/function/call-non-local-function-semantics/proxy.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,3 @@ | ||
const { platform } = require('./platform.js'); | ||
|
||
t.is(platform, 'browser'); |
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
Binary file not shown.
Oops, something went wrong.