Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
Add "location" and "process" to reserved words (#330)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
Torsten85 authored and lukastaegert committed Sep 18, 2018
1 parent 444a714 commit 5936873
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down

0 comments on commit 5936873

Please sign in to comment.