From 5936873feef6c2e8a95548ee16d92276f6d77d6b Mon Sep 17 00:00:00 2001 From: Torsten Blindert Date: Tue, 18 Sep 2018 07:19:46 +0200 Subject: [PATCH] Add "location" and "process" to reserved words (#330) Currently you can generate code with satements like `var process = ` or `var location = ` this is obviously a bad Idea vor node (case 1) or the browser (case 2) --- src/transform.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transform.js b/src/transform.js index a2a64cc..6eaf7bd 100644 --- a/src/transform.js +++ b/src/transform.js @@ -5,7 +5,7 @@ import { extractNames, flatten, isReference, isTruthy, isFalsy } from './ast-uti import { PREFIX, HELPERS_ID } from './helpers.js'; import { getName } from './utils.js'; -const reserved = 'abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split( ' ' ); +const reserved = 'process location abstract arguments boolean break byte case catch char class const continue debugger default delete do double else enum eval export extends false final finally float for from function goto if implements import in instanceof int interface let long native new null package private protected public return short static super switch synchronized this throw throws transient true try typeof var void volatile while with yield'.split( ' ' ); const blacklist = { __esModule: true }; reserved.forEach( word => blacklist[ word ] = true );