diff options
author | Matthew Flaschen <mflaschen@wikimedia.org> | 2015-01-17 17:08:01 -0500 |
---|---|---|
committer | Matthew Flaschen <mflaschen@wikimedia.org> | 2015-01-17 19:04:38 -0500 |
commit | c9d723e0fb18001273a076c6413c1f847812e508 (patch) | |
tree | cf7475035226adc8aa80db9b392550355a5cd4ab /lib/handlebars/compiler/javascript-compiler.js | |
parent | c5fe2527b393a1cc83948bdfd86b8b3783332eef (diff) | |
download | handlebars.js-c9d723e0fb18001273a076c6413c1f847812e508.zip handlebars.js-c9d723e0fb18001273a076c6413c1f847812e508.tar.gz handlebars.js-c9d723e0fb18001273a076c6413c1f847812e508.tar.bz2 |
Add missing reserved words so compiler knows to use array syntax:
* await
* null
* true
* false
IE 8 was failing to compile Handlebars-generated source code
because it had helpers.null.
I came up with this list by diffing
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords
against the ones Handlebars already had.
I added two corresponding tests for nameLookup.
Diffstat (limited to 'lib/handlebars/compiler/javascript-compiler.js')
-rw-r--r-- | lib/handlebars/compiler/javascript-compiler.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/handlebars/compiler/javascript-compiler.js b/lib/handlebars/compiler/javascript-compiler.js index 641daec..75f9960 100644 --- a/lib/handlebars/compiler/javascript-compiler.js +++ b/lib/handlebars/compiler/javascript-compiler.js @@ -1025,7 +1025,8 @@ var reservedWords = ( " class float package throws" + " const goto private transient" + " debugger implements protected volatile" + - " double import public let yield" + " double import public let yield await" + + " null true false" ).split(" "); var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; |