add more feature detection to 6to5/register
This commit is contained in:
@@ -6,7 +6,7 @@ var _ = require("lodash");
|
||||
|
||||
sourceMapSupport.install({
|
||||
retrieveSourceMap: function (source) {
|
||||
var map = maps[source];
|
||||
var map = maps && maps[source];
|
||||
if (map) {
|
||||
return {
|
||||
url: null,
|
||||
@@ -31,8 +31,23 @@ var blacklistTest = function (transformer, code) {
|
||||
}
|
||||
};
|
||||
|
||||
blacklistTest("generators", "function test *() {}");
|
||||
blacklistTest("letScoping", "let test = 0;");
|
||||
// array comprehension
|
||||
blacklistTest("arrowFunctions", "var foo = x => x * x;");
|
||||
blacklistTest("classes", "class Foo {}");
|
||||
// computed property names
|
||||
// constants
|
||||
// defaultParamters
|
||||
// descturing
|
||||
// forOf
|
||||
blacklistTest("generators", "function foo *() {}");
|
||||
blacklistTest("letScoping", "let foo = 0;");
|
||||
// modules
|
||||
// propertyMethodAssignment
|
||||
// propertyNameShorthand
|
||||
// restParameters
|
||||
// spread
|
||||
blacklistTest("templateLiterals", "`foo`");
|
||||
blacklistTest("unicodeRegex", "/foo/u");
|
||||
|
||||
//
|
||||
|
||||
@@ -79,5 +94,9 @@ module.exports = function (opts) {
|
||||
ignoreRegex = opts.ignoreRegex;
|
||||
}
|
||||
|
||||
if (opts.blacklist) {
|
||||
blacklist = opts.blacklist;
|
||||
}
|
||||
|
||||
if (opts.extensions) hookExtensions(opts.extensions);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user