-
Notifications
You must be signed in to change notification settings - Fork 801
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work around https://phabricator.babeljs.io/T7298
Fixes #246
- Loading branch information
Showing
4 changed files
with
59 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"presets": ["es2015"], | ||
"plugins": ["../../../../src/babel"] | ||
} |
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 @@ | ||
export function spread(...args) { | ||
return args.push(1) | ||
} |
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,38 @@ | ||
"use strict"; | ||
|
||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.spread = spread; | ||
function spread() { | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
|
||
return args.push(1); | ||
} | ||
|
||
(function () { | ||
function tagSource(fn, localName) { | ||
if (typeof fn !== "function") { | ||
return; | ||
} | ||
|
||
if (fn.hasOwnProperty("__source")) { | ||
return; | ||
} | ||
|
||
try { | ||
Object.defineProperty(fn, "__source", { | ||
enumerable: false, | ||
configurable: true, | ||
value: { | ||
fileName: __FILENAME__, | ||
localName: localName | ||
} | ||
}); | ||
} catch (err) {} | ||
} | ||
|
||
tagSource(spread, "spread"); | ||
})(); |