Skip to content
Permalink
Browse files

Merge pull request #26 from rollup/gh-21

blacklist all reserved words as export names
  • Loading branch information...
Rich-Harris committed Dec 28, 2015
2 parents ed57b87 + 8941e8d commit c3741cc81bd8217e9f265db6c3b554190495a58e
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/index.js
@@ -10,10 +10,10 @@ import { flatten, isReference } from './ast-utils.js';
var firstpass = /\b(?:require|module|exports|global)\b/;
var exportsPattern = /^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;

var blacklistedExports = {
__esModule: true,
default: true
};
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 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( ' ' );

var blacklistedExports = { __esModule: true };
reserved.forEach( word => blacklistedExports[ word ] = true );

function getName ( id ) {
const base = basename( id );

0 comments on commit c3741cc

Please sign in to comment.
You can’t perform that action at this time.