filamentgroup / Overthrow

A tiny, no-frills, framework-independent, targeted overflow: auto polyfill for use in responsive design.
MIT License
906 stars 94 forks source link

Goto - reserved Keyword in Javascript #77

Closed RubenGarcia-sevenval closed 1 year ago

RubenGarcia-sevenval commented 10 years ago

overthrow-sidescroller.goto.js contains a variable named goto, which is a reserved, albeit rarely used, keyword in js. This should not be a problem, but trying to minfy the source with YUI Compressor leads to

[ERROR] 42:44:missing variable name

[ERROR] 48:7:identifier is a reserved word

[ERROR] 58:38:identifier is a reserved word

[ERROR] 59:15:syntax error

[ERROR] 60:17:syntax error

[ERROR] 72:8:identifier is a reserved word

[ERROR] 73:13:syntax error

[ERROR] 81:10:identifier is a reserved word

[ERROR] 82:15:syntax error

[ERROR] 1:0:Compilation produced 9 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 9 syntax errors.
        at com.yahoo.platform.yui.compressor.YUICompressor$1.runtimeError(YUICompressor.java:154)
        at org.mozilla.javascript.Parser.parse(Parser.java:392)
        at org.mozilla.javascript.Parser.parse(Parser.java:337)
        at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)
        at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
        at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:131)
...

If you don't happen to have the YUI Compressor installed, you may use a online version here

A quick fix for this would be to replace togo with e.g. target