diff --git a/src/ast/keys.js b/src/ast/keys.js index 99d14ea..194ccf7 100644 --- a/src/ast/keys.js +++ b/src/ast/keys.js @@ -1,3 +1,4 @@ export default { - Program: [ 'body' ] + Program: [ 'body' ], + Literal: [] }; diff --git a/test/test.js b/test/test.js index 9697e6e..ca11679 100644 --- a/test/test.js +++ b/test/test.js @@ -93,6 +93,15 @@ describe( 'rollup', function () { assert.equal( err.message, 'Unexpected key \'plUgins\' found, expected one of: acorn, banner, cache, context, dest, entry, exports, external, footer, format, globals, indent, intro, moduleId, moduleName, noConflict, onwarn, outro, paths, plugins, preferConst, sourceMap, sourceMapFile, targets, treeshake, useStrict' ); }); }); + + it( 'treats Literals as leaf nodes, even if first literal encountered is null', () => { + // this test has to be up here, otherwise the bug doesn't have + // an opportunity to present itself + return rollup.rollup({ + entry: 'x', + plugins: [ loader({ x: `var a = null; a = 'a string';` }) ] + }); + }); }); describe( 'bundle.write()', () => {