UI-Grid : Error “Multiple definitions of a property not allowed in strict mode [object Object]” [ IE- Only ]

让人想犯罪 __ 提交于 2019-12-10 13:12:25

问题


While loading Ui-Grid In IE throwing error messages -

[true]  [SYSERR] Multiple definitions of a property not allowed in strict mode [object Object]

Issue is only in IE, Not throwing any errors in FireFox & Chrome. Tested on IE Version-11.

Thanks in Advance.


回答1:


As the error state, you are using somewhere an object that has more than one property with the same name . Something like :

var obj= {
    property1: 0,
    property2: 1,
    property1: 2
};

Printing the upper object results in :

{ property1: 2, property2: 1 }

Also searching a little bit on stack overflow, you can find a more detailed answer why this error is outputed in Internet Explorer

What's the purpose of allowing duplicate property names?




回答2:


Its difficult to find multiple definition manually when you have long code written by someone else.

I used http://jshint.com/ and pasted code there, it showed me all duplicate warnings and I fixed those everything worked.



来源:https://stackoverflow.com/questions/35497966/ui-grid-error-multiple-definitions-of-a-property-not-allowed-in-strict-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!