Created
November 1, 2014 09:05
-
-
Save sofish/c250881989aaa10c029d to your computer and use it in GitHub Desktop.
Error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"status":"error","error":{"msg":"\u6b64\u997f\u5355\u5df2\u6295\u8bc9","code":23}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
主要是 JavaScript 中以「{」开头,会存在二义性。即,它有可能是一个 对象直接量,也可能是一个 语句块。ECMAS 的处理方式十分简单粗暴:在语法解析的时候,如果一个语句以「{」开头,就只把它解释成 语句块。
只有为什么
{a:1}
没有错误,而{"a":1}
却抛出异常。是因为解析器把{a:1}
理解成了 标签,代码等同于:{ a: function () {} }
。PS:对于这个问题,node 已经解决。
更详细的可以看这里:http://www.cnblogs.com/maplejan/p/3768010.html