Merge branch 'master' into 7.0
This commit is contained in:
commit
ae8728c146
@ -108,8 +108,8 @@ Following is a table of the options you can use:
|
||||
| `moduleRoot` | `(sourceRoot)` | Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions. |
|
||||
| `only` | `null` | A [glob](https://github.com/isaacs/minimatch), regex, or mixed array of both, matching paths to **only** compile. Can also be an array of arrays containing paths to explicitly match. When attempting to compile a non-matching file it's returned verbatim. |
|
||||
| `parserOpts` | `{}` | An object containing the options to be passed down to the babel parser, babylon |
|
||||
| `plugins` | `[]` | List of [plugins](/docs/plugins/) to load and use. |
|
||||
| `presets` | `[]` | List of [presets](/docs/plugins/#presets) (a set of plugins) to load and use. |
|
||||
| `plugins` | `[]` | List of [plugins](https://babeljs.io/docs/plugins/) to load and use. |
|
||||
| `presets` | `[]` | List of [presets](https://babeljs.io/docs/plugins/#presets) (a set of plugins) to load and use. |
|
||||
| `retainLines` | `false` | Retain line numbers. This will lead to wacky code but is handy for scenarios where you can't use source maps. (**NOTE:** This will not retain the columns) |
|
||||
| `resolveModuleSource` | `null` | Resolve a module source ie. `import "SOURCE";` to a custom value. Called as `resolveModuleSource(source, filename)`. |
|
||||
| `shouldPrintComment` | `null` | An optional callback that controls whether a comment should be output or not. Called as `shouldPrintComment(commentContents)`. **NOTE:** This overrides the `comment` option when used. |
|
||||
|
||||
@ -37,6 +37,7 @@ minified | boolean | `false` | Should the output be minif
|
||||
concise | boolean | `false` | Set to `true` to reduce whitespace (but not as much as `opts.compact`)
|
||||
filename | string | | Used in warning messages
|
||||
jsonCompatibleStrings | boolean | `false` | Set to true to run `jsesc` with "json": true to print "\u00A9" vs. "©";
|
||||
|
||||
Options for source maps:
|
||||
|
||||
name | type | default | description
|
||||
|
||||
@ -0,0 +1,3 @@
|
||||
export {};
|
||||
|
||||
var obj = { await: function () {} };
|
||||
@ -0,0 +1,3 @@
|
||||
export {};
|
||||
|
||||
var obj = { await: function _await() {} };
|
||||
@ -167,6 +167,9 @@ export function isReferenced(node: Object, parent: Object): boolean {
|
||||
export function isValidIdentifier(name: string): boolean {
|
||||
if (typeof name !== "string" || esutils.keyword.isReservedWordES6(name, true)) {
|
||||
return false;
|
||||
} else if (name === "await") {
|
||||
// invalid in module, valid in script; better be safe (see #4952)
|
||||
return false;
|
||||
} else {
|
||||
return esutils.keyword.isIdentifierNameES6(name);
|
||||
}
|
||||
|
||||
@ -26,5 +26,9 @@ suite("validators", function () {
|
||||
|
||||
assert(t.isNodesEquivalent(parse(program), parse(program2)) === false);
|
||||
});
|
||||
|
||||
it("rejects 'await' as an identifier", function () {
|
||||
assert(t.isValidIdentifier("await") === false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user