I am using CSET, a library for Unicode character classes for Javascript. It loads fine in Firefox, IE8, and Opera, but fails in Google Chrome and Safari 4 with a syntax error. Strangely enough, the syntax errors are different.
From cset_production.js
:
Safari
SyntaxError: Parse error
(line 255)
CSET=function(){
// ...
var g=this
return {import:function(prefix,object){object=object||g
var i,l,e,es= // SyntaxError: Parse error (line 255)
[['fromChar',fC]
,['fromInt',fI]
,['universe',U]
,['nil',nil]
,['empty',empty]
,['singleton',one]
,['fromIntRange',fIR]
,['fromCharRange',fCR]
,['fromUnicodeGeneralCategory',fGC]
,['complement',comp]
,['fromList',fL]
,['fromString',fS]
,['member',member]
,['difference',diff]
,['union',union]
,['intersection',inter]
,['toRegex',reCC]
,['show',show]
]
for(i=0,l=es.length;i<l,e=es[i];i++)
object[(prefix||'')+e[0]]=e[1]}}
}();
What is the cause of Safari's syntax error and what can I do to correct the problem?
Google Chrome
uncaught exception SyntaxError: Invalid left-hand side in assignment
[hi,lo]=surrogatePair(c) // Line 200
Is this error called on legal code? Or is Google Chrome's parser correct in erroring on this line?