在 Google Chromium 下的 Javascript 中定义带下划线的函数名称
编辑:好的,这是我的问题。有同名配置未加载。 Firebug 警告我未找到对象 [name],但 Chromium 只显示“类型错误”。抱歉这个转储问题。
我定义了一个带有“类似标签”前缀的函数,其主名称如下:
async_fetchRecordAll() { //do something... }
如果在 Chromium 14.0.853 中调用该函数,控制台将报告错误:
"Type Error"
并且错误对象中的参数字段记录在控制台中显示
arguments : Array[2]
0 : "fetchRecordAll"
1 : undefined
(...)
但是如果我在 Firefox 4 中执行代码则一切正常。此命名规则是否与任何标准冲突?或者错误只是由另一个浏览器依赖的行为引起的?
EDIT: OK, it's my problem. There are a same name config didn't loaded. Firebug has warned me that object [name] didn't found but Chromium only show the "Type Error". Sorry for this dump question.
I've defined a function with a "tag-like" prefix and it's main name as below :
async_fetchRecordAll() { //do something... }
and if this function is called in Chromium 14.0.853 , the console will reports an error :
"Type Error"
and the arguments field in error object logged in console shows that
arguments : Array[2]
0 : "fetchRecordAll"
1 : undefined
(...)
But everything is OK if I execute the code in Firefox 4. Is this naming rule conflicted with any standard ? Or the error is just caused by another browser depended behavior ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不是必须使用
function
关键字吗?(不看代码我想不出其他的了)
Don't you have to use the
function
keyword?(I can't think of anything else without seeing the code)