简体   繁体   English

在instanceof检查中需要一个功能,但未定义

[英]Expecting a function in instanceof check, but got undefined

I am getting this weird error while working on a Polymer component and that is not it the biggest problem is that chrome somehow crashes when I try to debug the Polymer library. 我在处理Polymer组件时遇到这个奇怪的错误,这不是最大的问题是,当我尝试调试Polymer库时,chrome以某种方式崩溃了。 I am at my wits end trying to solve this bug. 我尽力解决这个错误。

The premise is simple I have a component with property data which is an array and it's changed by another component by setting it like someComponent.set('data', []); 前提很简单,我有一个带有属性data的组件,该组件是一个数组,可以通过将其设置为someComponent.set('data', []);更改它someComponent.set('data', []); . The set happens multiple times and the value set on data changes, at one point when the value is being set the error in title is thrown. 该设置发生多次,并且对data设置的值发生更改,在设置该值的某一时刻,会引发标题错误。 Following is the stack trace, since I can't reproduce the bug in a jsbin. 以下是堆栈跟踪,因为我无法在jsbin中重现该错误。

Polymer.dom @ polymer-mini.html:1040 Polymer.Base._addFeature.serializeValueToAttribute @ polymer.html:3416 Polymer.Base._addFeature.reflectPropertyToAttribute @ polymer-micro.html:593 Polymer.Base.extend._reflectEffect @ polymer.html:1607 Polymer.Bind._modelApi._effectEffects @ polymer.html:1461 Polymer.Bind._modelApi._propertySetter @ polymer.html:1445 setter @ polymer.html:1524 Polymer.Base._addFeature.set @ polymer.html:2103 Polymer.updateTargets @ t-demo-atom.html:234

Maybe this would work: 也许这会工作:

-in the child, create a function to set data to an incoming value -在子级中,创建一个将数据设置为传入值的函数

-in the father, just call that function instead of setting the data value yourself -在父亲中,只需调用该函数即可,而不是自己设置数据值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Node.js:在instanceof检查中需要一个函数,但未定义 - Nodejs: Expecting a function in instanceof check but got undefined 在instanceof检查中期望有一个功能,但是变得很正文-试图在Backbone中创建视图 - Expecting a function in instanceof check, but got body - Trying to create view in Backbone 未捕获的TypeError:期望在instanceof检查中的函数 - Uncaught TypeError: Expecting a function in instanceof check JSON错误:期待......得到'未定义' - JSON error: Expecting … got 'undefined' 如何检查 function 中定义的 class 实例? - How to check instanceof class that is defined within a function? AddDevicemodalCtrl不是函数,未定义 - AddDevicemodalCtrl is not a function, got undefined 参数...不是函数,未定义 - Argument … is not a function, got undefined 期待'ID','STRING','NUMBER','BOOLEAN','UNDEFINED','NULL','DATA',得到'INVALID' - Expecting 'ID', 'STRING', 'NUMBER', 'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', got 'INVALID' 检查咖喱 function 是否仍然期待进一步的 arguments - Check if a curried function is still expecting further arguments 参数“ myController”不是函数,未定义 - Argument 'myController' is not a function, got undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM