Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
82415e4
commit 42105c0
Showing
13 changed files
with
13 additions
and
72 deletions.
There are no files selected for viewing
7 changes: 1 addition & 6 deletions
7
packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-glob/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,11 +1,6 @@ | ||
define(["foo"], function (foo) { | ||
"use strict"; | ||
|
||
foo = _interopRequireWildcard(foo); | ||
|
||
function _getRequireWildcardCache(i) { if (typeof WeakMap !== "function") return null; var cache = [new WeakMap(), new WeakMap()]; _getRequireWildcardCache = function (i) { return cache[i]; }; return cache[i]; } | ||
|
||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(+!!nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key) && key !== "default") { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
|
||
foo = babelHelpers.interopRequireWildcard(foo); | ||
foo; | ||
}); |
7 changes: 1 addition & 6 deletions
7
packages/babel-plugin-transform-modules-amd/test/fixtures/amd/imports-mixing/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,12 +1,7 @@ | ||
define(["foo"], function (_foo) { | ||
"use strict"; | ||
|
||
_foo = _interopRequireWildcard(_foo); | ||
|
||
function _getRequireWildcardCache(i) { if (typeof WeakMap !== "function") return null; var cache = [new WeakMap(), new WeakMap()]; _getRequireWildcardCache = function (i) { return cache[i]; }; return cache[i]; } | ||
|
||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(+!!nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key) && key !== "default") { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
|
||
_foo = babelHelpers.interopRequireWildcard(_foo); | ||
_foo.default; | ||
_foo.baz; | ||
}); |
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
7 changes: 1 addition & 6 deletions
7
packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-glob/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,11 +1,6 @@ | ||
define(["foo"], function (foo) { | ||
"use strict"; | ||
|
||
foo = _interopRequireWildcard(foo); | ||
|
||
function _getRequireWildcardCache(i) { if (typeof WeakMap !== "function") return null; var cache = [new WeakMap(), new WeakMap()]; _getRequireWildcardCache = function (i) { return cache[i]; }; return cache[i]; } | ||
|
||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(+!!nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key) && key !== "default") { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
|
||
foo = babelHelpers.interopRequireWildcard(foo); | ||
foo; | ||
}); |
7 changes: 1 addition & 6 deletions
7
packages/babel-plugin-transform-modules-amd/test/fixtures/loose/imports-mixing/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,12 +1,7 @@ | ||
define(["foo"], function (_foo) { | ||
"use strict"; | ||
|
||
_foo = _interopRequireWildcard(_foo); | ||
|
||
function _getRequireWildcardCache(i) { if (typeof WeakMap !== "function") return null; var cache = [new WeakMap(), new WeakMap()]; _getRequireWildcardCache = function (i) { return cache[i]; }; return cache[i]; } | ||
|
||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(+!!nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key) && key !== "default") { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
|
||
_foo = babelHelpers.interopRequireWildcard(_foo); | ||
_foo.default; | ||
_foo.baz; | ||
}); |
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
6 changes: 1 addition & 5 deletions
6
...abel-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-glob/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,7 +1,3 @@ | ||
"use strict"; | ||
|
||
var foo = _interopRequireWildcard(require("foo")); | ||
|
||
function _getRequireWildcardCache(i) { if (typeof WeakMap !== "function") return null; var cache = [new WeakMap(), new WeakMap()]; _getRequireWildcardCache = function (i) { return cache[i]; }; return cache[i]; } | ||
|
||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(+!!nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key) && key !== "default") { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var foo = babelHelpers.interopRequireWildcard(require("foo")); |
6 changes: 1 addition & 5 deletions
6
...el-plugin-transform-modules-commonjs/test/fixtures/interop-loose/imports-mixing/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,10 +1,6 @@ | ||
"use strict"; | ||
|
||
var _foo = _interopRequireWildcard(require("foo")); | ||
|
||
function _getRequireWildcardCache(i) { if (typeof WeakMap !== "function") return null; var cache = [new WeakMap(), new WeakMap()]; _getRequireWildcardCache = function (i) { return cache[i]; }; return cache[i]; } | ||
|
||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(+!!nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key) && key !== "default") { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var _foo = babelHelpers.interopRequireWildcard(require("foo")); | ||
|
||
_foo.default; | ||
_foo.baz; |
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
6 changes: 1 addition & 5 deletions
6
...ages/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-glob/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,7 +1,3 @@ | ||
"use strict"; | ||
|
||
var foo = _interopRequireWildcard(require("foo")); | ||
|
||
function _getRequireWildcardCache(i) { if (typeof WeakMap !== "function") return null; var cache = [new WeakMap(), new WeakMap()]; _getRequireWildcardCache = function (i) { return cache[i]; }; return cache[i]; } | ||
|
||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(+!!nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key) && key !== "default") { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var foo = babelHelpers.interopRequireWildcard(require("foo")); |
6 changes: 1 addition & 5 deletions
6
...es/babel-plugin-transform-modules-commonjs/test/fixtures/interop/imports-mixing/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,10 +1,6 @@ | ||
"use strict"; | ||
|
||
var _foo = _interopRequireWildcard(require("foo")); | ||
|
||
function _getRequireWildcardCache(i) { if (typeof WeakMap !== "function") return null; var cache = [new WeakMap(), new WeakMap()]; _getRequireWildcardCache = function (i) { return cache[i]; }; return cache[i]; } | ||
|
||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(+!!nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key) && key !== "default") { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var _foo = babelHelpers.interopRequireWildcard(require("foo")); | ||
|
||
_foo.default; | ||
_foo.baz; |
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