Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f912f548e | ||
|
|
41d721e372 | ||
|
|
df6ffe025c | ||
|
|
28b6b4af44 | ||
|
|
9e80071caa | ||
|
|
0da4303358 | ||
|
|
83e225f30a | ||
|
|
420505ca40 | ||
|
|
f9a26fd903 | ||
|
|
ca0539190e | ||
|
|
2e3226b520 | ||
|
|
7959852eeb | ||
|
|
c129eba712 | ||
|
|
0e2d7fa941 | ||
|
|
0b33a62032 | ||
|
|
6919ed2b34 | ||
|
|
435320e3f9 | ||
|
|
7b846af965 | ||
|
|
18b836c16a | ||
|
|
fb360039ce | ||
|
|
4763b95a0d | ||
|
|
9fe1e37ca7 | ||
|
|
8a9aac3e68 | ||
|
|
27138abd29 | ||
|
|
dcf91db475 | ||
|
|
ab63345764 |
1
.jscsrc
1
.jscsrc
@@ -33,7 +33,6 @@
|
||||
"requireCommaBeforeLineBreak": true,
|
||||
"requireSpaceBeforeBinaryOperators": true,
|
||||
"requireSpaceAfterBinaryOperators": true,
|
||||
"requireCamelCaseOrUpperCaseIdentifiers": true,
|
||||
"requireLineFeedAtFileEnd": true,
|
||||
"requireCapitalizedConstructors": true,
|
||||
"requireDotNotation": true,
|
||||
|
||||
15
CHANGELOG.md
15
CHANGELOG.md
@@ -11,6 +11,21 @@
|
||||
|
||||
_Note: Gaps between patch versions are faulty/broken releases._
|
||||
|
||||
## 3.3.4
|
||||
|
||||
* **Polish**
|
||||
* Add istanbul `require` interop.
|
||||
* **Bug Fix**
|
||||
* Fix incorrect source map column tracking in specific scenarios.
|
||||
|
||||
## 3.3.3
|
||||
|
||||
* **Polish**
|
||||
* Remap top level `this` to `undefined` instead of throwing an error.
|
||||
* **Bug Fix**
|
||||
* Run `selfContained` transformer over the regenerator runtime when building `6to5-runtime`.
|
||||
* Fix `t.isReferenced` not properly allowing `value` nodes.
|
||||
|
||||
## 3.3.1
|
||||
|
||||
* **Bug Fix**
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* when found, before invoking the "real" _6to5-node(1) executable.
|
||||
*/
|
||||
|
||||
var args = ["--harmony", __dirname + "/_6to5-node"];
|
||||
var args = [__dirname + "/_6to5-node"];
|
||||
|
||||
process.argv.slice(2).forEach(function(arg){
|
||||
var flag = arg.split("=")[0];
|
||||
|
||||
@@ -179,7 +179,7 @@ CodeGenerator.prototype.print = function (node, parent, opts) {
|
||||
newline(true);
|
||||
|
||||
if (opts.before) opts.before();
|
||||
this.map.mark(node, "start");
|
||||
this.map.mark(node);
|
||||
|
||||
this[node.type](node, this.buildPrint(node), parent);
|
||||
|
||||
@@ -189,7 +189,6 @@ CodeGenerator.prototype.print = function (node, parent, opts) {
|
||||
}
|
||||
if (needsParens) this.push(")");
|
||||
|
||||
this.map.mark(node, "end");
|
||||
if (opts.after) opts.after();
|
||||
|
||||
newline(false);
|
||||
|
||||
@@ -30,7 +30,7 @@ SourceMap.prototype.get = function () {
|
||||
}
|
||||
};
|
||||
|
||||
SourceMap.prototype.mark = function (node, type) {
|
||||
SourceMap.prototype.mark = function (node) {
|
||||
var loc = node.loc;
|
||||
if (!loc) return; // no location info
|
||||
|
||||
@@ -46,9 +46,7 @@ SourceMap.prototype.mark = function (node, type) {
|
||||
column: position.column
|
||||
};
|
||||
|
||||
var original = loc[type];
|
||||
|
||||
if (generated.line === original.line && generated.column === original.column) return; // nothing to map
|
||||
var original = loc.start;
|
||||
|
||||
map.addMapping({
|
||||
source: this.opts.sourceFileName,
|
||||
|
||||
0
lib/6to5/optimisation/index.js
Normal file
0
lib/6to5/optimisation/index.js
Normal file
@@ -34,20 +34,14 @@ var cache = registerCache.get();
|
||||
var transformOpts = {};
|
||||
var ignoreRegex = /node_modules/;
|
||||
var onlyRegex;
|
||||
var whitelist = [];
|
||||
var exts = {};
|
||||
var maps = {};
|
||||
var old = require.extensions[".js"];
|
||||
|
||||
var mtime = function (filename) {
|
||||
return +fs.statSync(filename).mtime;
|
||||
};
|
||||
|
||||
var loader = function (m, filename) {
|
||||
if ((ignoreRegex && ignoreRegex.test(filename)) || (onlyRegex && !onlyRegex.test(filename))) {
|
||||
return old.apply(this, arguments);
|
||||
}
|
||||
|
||||
var compile = function (filename) {
|
||||
var result;
|
||||
|
||||
if (cache) {
|
||||
@@ -57,11 +51,12 @@ var loader = function (m, filename) {
|
||||
}
|
||||
}
|
||||
|
||||
result = result || to5.transformFileSync(filename, extend({
|
||||
whitelist: whitelist,
|
||||
sourceMap: true,
|
||||
ast: false
|
||||
}, transformOpts));
|
||||
if (!result) {
|
||||
result = to5.transformFileSync(filename, extend({
|
||||
sourceMap: true,
|
||||
ast: false
|
||||
}, transformOpts));
|
||||
}
|
||||
|
||||
if (cache) {
|
||||
result.mtime = mtime(filename);
|
||||
@@ -70,7 +65,43 @@ var loader = function (m, filename) {
|
||||
|
||||
maps[filename] = result.map;
|
||||
|
||||
m._compile(result.code, filename);
|
||||
return result.code;
|
||||
};
|
||||
|
||||
var shouldIgnore = function (filename) {
|
||||
return (ignoreRegex && ignoreRegex.test(filename)) || (onlyRegex && !onlyRegex.test(filename));
|
||||
};
|
||||
|
||||
var istanbulLoader = function (m, filename, old) {
|
||||
// we need to monkey patch fs.readFileSync so we can hook into
|
||||
// what istanbul gets, it's extremely dirty but it's the only way
|
||||
var _readFileSync = fs.readFileSync;
|
||||
|
||||
fs.readFileSync = function () {
|
||||
fs.readFileSync = _readFileSync;
|
||||
return compile(filename);
|
||||
};
|
||||
|
||||
old(m, filename);
|
||||
};
|
||||
|
||||
var normalLoader = function (m, filename) {
|
||||
m._compile(compile(filename), filename);
|
||||
};
|
||||
|
||||
var registerExtension = function (ext) {
|
||||
var old = require.extensions[ext];
|
||||
|
||||
var loader = normalLoader;
|
||||
if (process.env.running_under_istanbul) loader = istanbulLoader; // jshint ignore:line
|
||||
|
||||
require.extensions[ext] = function (m, filename) {
|
||||
if (shouldIgnore(filename)) {
|
||||
old(m, filename);
|
||||
} else {
|
||||
loader(m, filename, old);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
var hookExtensions = function (_exts) {
|
||||
@@ -82,7 +113,7 @@ var hookExtensions = function (_exts) {
|
||||
|
||||
each(_exts, function (ext) {
|
||||
exts[ext] = require.extensions[ext];
|
||||
require.extensions[ext] = loader;
|
||||
registerExtension(ext);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
22
lib/6to5/transformation/helpers/react.js
vendored
Normal file
22
lib/6to5/transformation/helpers/react.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
var t = require("../../types");
|
||||
|
||||
var isCreateClassCallExpression = t.buildMatchMemberExpression("React.createClass");
|
||||
|
||||
exports.isCreateClass = function (node) {
|
||||
if (!node || !t.isCallExpression(node)) return false;
|
||||
|
||||
// not React.createClass call member object
|
||||
if (!isCreateClassCallExpression(node.callee)) return false;
|
||||
|
||||
// no call arguments
|
||||
var args = node.arguments;
|
||||
if (args.length !== 1) return false;
|
||||
|
||||
// first node arg is not an object
|
||||
var first = args[0];
|
||||
if (!t.isObjectExpression(first)) return false;
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
exports.isReactComponent = t.buildMatchMemberExpression("React.Component");
|
||||
@@ -6,6 +6,7 @@
|
||||
// jsx
|
||||
|
||||
var esutils = require("esutils");
|
||||
var react = require("../../helpers/react");
|
||||
var t = require("../../../types");
|
||||
|
||||
exports.JSXIdentifier = function (node, parent) {
|
||||
@@ -197,33 +198,8 @@ var cleanJSXElementLiteralChild = function (child, args) {
|
||||
|
||||
// display names
|
||||
|
||||
var isCreateClass = function (call) {
|
||||
if (!call || !t.isCallExpression(call)) return false;
|
||||
|
||||
var callee = call.callee;
|
||||
if (!t.isMemberExpression(callee)) return false;
|
||||
|
||||
// not React call member object
|
||||
var obj = callee.object;
|
||||
if (!t.isIdentifier(obj, { name: "React" })) return false;
|
||||
|
||||
// not createClass call member property
|
||||
var prop = callee.property;
|
||||
if (!t.isIdentifier(prop, { name: "createClass" })) return false;
|
||||
|
||||
// no call arguments
|
||||
var args = call.arguments;
|
||||
if (args.length !== 1) return false;
|
||||
|
||||
// first call arg is not an object
|
||||
var first = args[0];
|
||||
if (!t.isObjectExpression(first)) return;
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
var addDisplayName = function (id, call) {
|
||||
if (!isCreateClass(call)) return;
|
||||
if (!react.isCreateClass(call)) return;
|
||||
|
||||
var props = call.arguments[0].properties;
|
||||
var safe = true;
|
||||
|
||||
@@ -16,6 +16,6 @@ exports.FunctionExpression = function (node, parent, scope, context) {
|
||||
context.skip();
|
||||
};
|
||||
|
||||
exports.ThisExpression = function (node, parent, scope, context, file) {
|
||||
throw file.errorWithNode(node, "Top level `this` is `undefined` in strict mode", ReferenceError);
|
||||
exports.ThisExpression = function () {
|
||||
return t.identifier("undefined");
|
||||
};
|
||||
|
||||
@@ -257,8 +257,9 @@ t.isReferenced = function (node, parent) {
|
||||
}
|
||||
|
||||
// yes: { [NODE]: "" }
|
||||
if (t.isProperty(parent)) {
|
||||
return parent.key === node && parent.computed;
|
||||
// no: { NODE: "" }
|
||||
if (t.isProperty(parent) && parent.key === node) {
|
||||
return parent.computed;
|
||||
}
|
||||
|
||||
// no: var NODE = init;
|
||||
@@ -399,6 +400,65 @@ t.ensureBlock = function (node, key) {
|
||||
node[key] = t.toBlock(node[key], node);
|
||||
};
|
||||
|
||||
/**
|
||||
* Build a function that when called will return whether or not the
|
||||
* input `node` `MemberExpression` matches the input `match`.
|
||||
*
|
||||
* For example, given the match `React.createClass` it would match the
|
||||
* parsed nodes of `React.createClass` and `React["createClass"]`.
|
||||
*
|
||||
* @param {String} match Dot delimetered string
|
||||
* @param {Boolean} [allowPartial] Allow a partial match
|
||||
* @returns {Function}
|
||||
*/
|
||||
|
||||
t.buildMatchMemberExpression = function (match, allowPartial) {
|
||||
var parts = match.split(".");
|
||||
|
||||
return function (member) {
|
||||
// not a member expression
|
||||
if (!t.isMemberExpression(member)) return false;
|
||||
|
||||
var search = [member];
|
||||
var i = 0;
|
||||
|
||||
while (search.length) {
|
||||
var node = search.shift();
|
||||
|
||||
if (t.isIdentifier(node)) {
|
||||
// this part doesn't match
|
||||
if (parts[i] !== node.name) return false;
|
||||
} else if (t.isLiteral(node)) {
|
||||
// this part doesn't match
|
||||
if (parts[i] !== node.value) return false;
|
||||
} else if (t.isMemberExpression(node)) {
|
||||
if (node.computed && !t.isLiteral(node.property)) {
|
||||
// we can't deal with this
|
||||
return false;
|
||||
} else {
|
||||
search.push(node.object);
|
||||
search.push(node.property);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// we can't deal with this
|
||||
return false;
|
||||
}
|
||||
|
||||
// too many parts
|
||||
if (++i > parts.length) {
|
||||
if (allowPartial) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Description
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "6to5",
|
||||
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
||||
"version": "3.3.1",
|
||||
"version": "3.3.4",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://6to5.org/",
|
||||
"repository": "6to5/6to5",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "6to5-runtime",
|
||||
"description": "6to5 selfContained runtime",
|
||||
"version": "3.3.0",
|
||||
"version": "3.3.3",
|
||||
"repository": "6to5/6to5",
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>"
|
||||
}
|
||||
@@ -30,6 +30,12 @@ var updatePackage = function () {
|
||||
writeFile("package.json", JSON.stringify(pkg, null, 2));
|
||||
};
|
||||
|
||||
var selfContainify = function (code) {
|
||||
return transform(code, {
|
||||
optional: ["selfContained"]
|
||||
}).code;
|
||||
};
|
||||
|
||||
var buildHelpers2 = function () {
|
||||
var body = [];
|
||||
var tree = t.program(body);
|
||||
@@ -44,5 +50,5 @@ var buildHelpers2 = function () {
|
||||
writeFile("helpers.js", buildHelpers2());
|
||||
writeFile("core-js.js", readFile("core-js/library"));
|
||||
writeFile("regenerator/index.js", readFile("regenerator-6to5/runtime-module"));
|
||||
writeFile("regenerator/runtime.js", readFile("regenerator-6to5/runtime"));
|
||||
writeFile("regenerator/runtime.js", selfContainify(readFile("regenerator-6to5/runtime")));
|
||||
updatePackage();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"use strict";
|
||||
|
||||
var Test = function Test() {};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9iYXIvYmFyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0lBQU0sSUFBSSxZQUFKLElBQUkiLCJmaWxlIjoic3JjL2Jhci9iYXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJjbGFzcyBUZXN0IHtcblxufSJdfQ==
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9iYXIvYmFyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0lBQU0sZ0JBQUEiLCJmaWxlIjoic3JjL2Jhci9iYXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJjbGFzcyBUZXN0IHtcblxufSJdfQ==
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
arr.map(function (x) {
|
||||
return x * MULTIPLIER;
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9mb28uanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxHQUFHLENBQUMsR0FBRyxDQUFDLFVBQUEsQ0FBQztTQUFJLENBQUMsR0FBRyxVQUFVO0NBQUEsQ0FBQyxDQUFDIiwiZmlsZSI6InNyYy9mb28uanMiLCJzb3VyY2VzQ29udGVudCI6WyJhcnIubWFwKHggPT4geCAqIE1VTFRJUExJRVIpOyJdfQ==
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9mb28uanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxJQUFJLElBQUksVUFBQTtTQUFLLElBQUkiLCJmaWxlIjoic3JjL2Zvby5qcyIsInNvdXJjZXNDb250ZW50IjpbImFyci5tYXAoeCA9PiB4ICogTVVMVElQTElFUik7Il19
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["src/bar/bar.js"],"names":[],"mappings":";;IAAM,IAAI,YAAJ,IAAI","file":"src/bar/bar.js","sourcesContent":["class Test {\n\n}"]}
|
||||
{"version":3,"sources":["src/bar/bar.js"],"names":[],"mappings":";;IAAM,gBAAA","file":"src/bar/bar.js","sourcesContent":["class Test {\n\n}"]}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["src/foo.js"],"names":[],"mappings":";;AAAA,GAAG,CAAC,GAAG,CAAC,UAAA,CAAC;SAAI,CAAC,GAAG,UAAU;CAAA,CAAC,CAAC","file":"src/foo.js","sourcesContent":["arr.map(x => x * MULTIPLIER);"]}
|
||||
{"version":3,"sources":["src/foo.js"],"names":[],"mappings":";;AAAA,IAAI,IAAI,UAAA;SAAK,IAAI","file":"src/foo.js","sourcesContent":["arr.map(x => x * MULTIPLIER);"]}
|
||||
|
||||
@@ -4,4 +4,4 @@ arr.map(function (x) {
|
||||
return x * MULTIPLIER;
|
||||
});
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLEdBQUcsQ0FBQyxHQUFHLENBQUMsVUFBQSxDQUFDO1NBQUksQ0FBQyxHQUFHLFVBQVU7Q0FBQSxDQUFDLENBQUMiLCJmaWxlIjoic2NyaXB0Mi5qcyIsInNvdXJjZXNDb250ZW50IjpbImFyci5tYXAoeCA9PiB4ICogTVVMVElQTElFUik7Il19
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLElBQUksSUFBSSxVQUFBO1NBQUssSUFBSSIsImZpbGUiOiJzY3JpcHQyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiYXJyLm1hcCh4ID0+IHggKiBNVUxUSVBMSUVSKTsiXX0=
|
||||
|
||||
@@ -7,5 +7,4 @@ arr.map(function (x) {
|
||||
return x * MULTIPLIER;
|
||||
});
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyIsInNjcmlwdDIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7SUFBTSxJQUFJLFlBQUosSUFBSTs7OztBQ0FWLEdBQUcsQ0FBQyxHQUFHLENBQUMsVUFBQSxDQUFDO1NBQUksQ0FBQyxHQUFHLFVBQVU7Q0FBQSxDQUFDLENBQUMiLCJmaWxlIjoic2NyaXB0My5qcyIsInNvdXJjZXNDb250ZW50IjpbImNsYXNzIFRlc3Qge1xuXG59IiwiYXJyLm1hcCh4ID0+IHggKiBNVUxUSVBMSUVSKTsiXX0=
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjcmlwdC5qcyIsInNjcmlwdDIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7SUFBTSxnQkFBQTs7OztBQ0FOLElBQUksSUFBSSxVQUFBO1NBQUssSUFBSSIsImZpbGUiOiJzY3JpcHQzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiY2xhc3MgVGVzdCB7XG5cbn0iLCJhcnIubWFwKHggPT4geCAqIE1VTFRJUExJRVIpOyJdfQ==
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["script.js","script2.js"],"names":[],"mappings":";;IAAM,IAAI,YAAJ,IAAI;;;;ACAV,GAAG,CAAC,GAAG,CAAC,UAAA,CAAC;SAAI,CAAC,GAAG,UAAU;CAAA,CAAC,CAAC","file":"script3.js","sourcesContent":["class Test {\n\n}","arr.map(x => x * MULTIPLIER);"]}
|
||||
{"version":3,"sources":["script.js","script2.js"],"names":[],"mappings":";;IAAM,gBAAA;;;;ACAN,IAAI,IAAI,UAAA;SAAK,IAAI","file":"script3.js","sourcesContent":["class Test {\n\n}","arr.map(x => x * MULTIPLIER);"]}
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"sources":["stdin"],"names":[],"mappings":";;AAAA,GAAG,CAAC,GAAG,CAAC,UAAA,CAAC;SAAI,CAAC,GAAG,CAAC;CAAA,CAAC,CAAC","file":"test.js","sourcesContent":["arr.map(x => x * x);"]}
|
||||
{"version":3,"sources":["stdin"],"names":[],"mappings":";;AAAA,IAAI,IAAI,UAAA;SAAK,IAAI","file":"test.js","sourcesContent":["arr.map(x => x * x);"]}
|
||||
|
||||
@@ -4,4 +4,4 @@ arr.map(function (x) {
|
||||
return x * x;
|
||||
});
|
||||
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsR0FBRyxDQUFDLEdBQUcsQ0FBQyxVQUFBLENBQUM7U0FBSSxDQUFDLEdBQUcsQ0FBQztDQUFBLENBQUMsQ0FBQyIsImZpbGUiOiJzdGRvdXQiLCJzb3VyY2VzQ29udGVudCI6WyJhcnIubWFwKHggPT4geCAqIHgpOyJdfQ==
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsSUFBSSxJQUFJLFVBQUE7U0FBSyxJQUFJIiwiZmlsZSI6InN0ZG91dCIsInNvdXJjZXNDb250ZW50IjpbImFyci5tYXAoeCA9PiB4ICogeCk7Il19
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
[{
|
||||
"original": {
|
||||
"line": 1,
|
||||
"column": 18
|
||||
"column": 13
|
||||
},
|
||||
"generated": {
|
||||
"line": 4,
|
||||
"column": 14
|
||||
"column": 10
|
||||
}
|
||||
}]
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
"file": "source-maps/full/expected.js",
|
||||
"sources": ["source-maps/full/actual.js"],
|
||||
"names": [],
|
||||
"mappings": ";;AAAA,GAAG,CAAC,GAAG,CAAC,UAAA,CAAC;SAAI,CAAC,GAAG,CAAC;CAAA,CAAC,CAAC",
|
||||
"mappings": ";;AAAA,IAAI,IAAI,UAAA;SAAK,IAAI",
|
||||
"sourcesContent": ["arr.map(x => x * x);"]
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
arr.map(function (x) {
|
||||
return x * x;
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNvdXJjZS1tYXBzL2lubGluZS9hY3R1YWwuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxHQUFHLENBQUMsR0FBRyxDQUFDLFVBQUEsQ0FBQztTQUFJLENBQUMsR0FBRyxDQUFDO0NBQUEsQ0FBQyxDQUFDIiwiZmlsZSI6InNvdXJjZS1tYXBzL2lubGluZS9leHBlY3RlZC5qcyIsInNvdXJjZXNDb250ZW50IjpbImFyci5tYXAoeCA9PiB4ICogeCk7Il19
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNvdXJjZS1tYXBzL2lubGluZS9hY3R1YWwuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxJQUFJLElBQUksVUFBQTtTQUFLLElBQUkiLCJmaWxlIjoic291cmNlLW1hcHMvaW5saW5lL2V4cGVjdGVkLmpzIiwic291cmNlc0NvbnRlbnQiOlsiYXJyLm1hcCh4ID0+IHggKiB4KTsiXX0=
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"throws": "Top level `this` is `undefined` in strict mode"
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"throws": "Top level `this` is `undefined` in strict mode"
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"throws": "Top level `this` is `undefined` in strict mode"
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"throws": "Top level `this` is `undefined` in strict mode"
|
||||
}
|
||||
5
test/fixtures/transformation/use-strict/undefined-this-arrow-function/expected.js
vendored
Normal file
5
test/fixtures/transformation/use-strict/undefined-this-arrow-function/expected.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
var foo = function () {
|
||||
return undefined;
|
||||
};
|
||||
3
test/fixtures/transformation/use-strict/undefined-this-root-call/expected.js
vendored
Normal file
3
test/fixtures/transformation/use-strict/undefined-this-root-call/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
undefined.foo();
|
||||
3
test/fixtures/transformation/use-strict/undefined-this-root-declaration/expected.js
vendored
Normal file
3
test/fixtures/transformation/use-strict/undefined-this-root-declaration/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
var self = undefined;
|
||||
3
test/fixtures/transformation/use-strict/undefined-this-root-reference/expected.js
vendored
Normal file
3
test/fixtures/transformation/use-strict/undefined-this-root-reference/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
undefined;
|
||||
Reference in New Issue
Block a user