草庐IT

CPPUNIT_TEST_SUITE_PROPERTY

全部标签

javascript - 包裹在 setTimeout 中时出现错误 "Cannot read property of undefined"

这个问题在这里已经有了答案:Passcorrect"this"contexttosetTimeoutcallback?(6个答案)关闭6年前。我一直在编写一段代码,旨在处理单个网页上的多个小视频元素,但我无法使多个进度条与其各自的视频同步。(CurrentjsFiddleprototype)这段代码$(this).find("progress").attr("value",$("video",this)[0].currentTime);似乎有效在主函数中,但是当我用setTimeout将它包装在另一个函数中时,进度条实际上是动画的,我得到了这个错误:"Cannotreadpropert

javascript - 如何在此 React 组件中修复“对象的 "Cannot assign to read only property ' 样式”?

我正在创建自己的自定义选项卡组件。它由一个选项卡标题组成,每个选项卡标题都有一个正文部分。单击选项卡标题时,应将相应主体的样式设置为display:block,将所有其他样式设置为display:none。由于某些原因,我收到此错误:Cannotassigntoreadonlyproperty'style'ofobject我知道我不能手动更改样式属性,因为它似乎是只读的,但我该如何解决/解决这个问题?这是我的代码:Tabs.jsimportReact,{Component}from'react';classTabsextendsComponent{constructor(){super

javascript - 使用 Chutzpah 运行 QUnit (TypeScript) 测试给出 "Called start() outside of a test context while already started"

我有一个相当简单的重现,结果我不明白。确保安装了Chutpah测试适配器4.0.3。使用VisualStudio2013执行以下步骤:创建一个新的.NET4.5.1类库项目;添加NuGet包qunit.TypeScript.DefinitelyTyped0.1.7;将TypeScript文件file1.ts添加到项目中,内容如下:///QUnit.test("QUnitisworking",assert=>assert.ok(true));在该文件内右键单击并从上下文菜单中选择“运行JS测试”。我可以确认file1.js是按预期生成的。结果是没有运行任何测试,测试资源管理器没有显示测试

javascript - Angular2/Typescript/ngRx - 类型错误 : Cannot assign to read only property of object

在构造函数中我做了这样的事情selectedDate:Object;//construtorthis.selectedDate={};this.selectedDate['date']=newDate();this.selectedDate['pristine']=newDate();在另一个通过单击按钮调用的函数中,我执行以下操作:this.selectedDate['date']=newDate(this.selectedDate['pristine']);我收到以下错误:TypeError:Cannotassigntoreadonlyproperty'date'ofobject'

javascript - QML 文本字段 : Binding loop detected for property "text"

我正在使用带有JavaScript的QML。我想知道以下错误的确切含义,以便我可以修复它:QMLTextField:Bindingloopdetectedforproperty"text"有时我的应用会给我这个警告,但我不明白 最佳答案 检测到属性fooProperty的绑定(bind)循环通常意味着您可能创建了一个相互依赖的绑定(bind)。你应该检查两件事:检查fooProperty是否绑定(bind)到某个属性,该属性在某些情况下又绑定(bind)回fooProperty。(一种循环依赖)此外,请检查是否在某些情况下,fooP

javascript - '错误 : Unexpected request' during Karma Angular Unit Test

运行gruntkarma时,其中一个指令的测试在尝试获取模板时失败。我使用ng-html2js作为预处理器。这是我的一些karma.conf.jsplugins:['karma-chrome-launcher','karma-jasmine','ng-html2js','karma-ng-html2js-preprocessor'],preprocessors:{'app/scripts/directives/**/*.html':'ng-html2js'},ngHtml2JsPreprocessor:{moduleName:'templates'}在我的测试中,我有以下内容:'use

javascript - AngularJS 未知类型错误 : Cannot Read Property '1' Of Null

下面是我遇到问题的代码://MainCodesfortheDiaryApp(function(){//Createanewdiaryappvardiary=angular.module('diary',['ngRoute']);//DefineaRouterfortheAppdiary.config(function($routeProvider){$routeProvider.when('/',{templateUrl:'partials/wall.php',controller:'DiaryWallController'}).when('/images',{templateUrl:

javascript - "Unable to get value of the property ' appendChild ': object is null or undefined"同时将脚本附加到 IE

当我尝试将以下脚本附加到IE时,出现此错误:“错误:无法获取属性‘appendChild’的值:对象为空或未定义”它在Chrome中运行良好,但在IE9上测试时会出现这种情况。谁能告诉我错误是什么?//createscriptindocumentvarfbScript=document.createElement("script");fbScript.type="text/javascript";//makescriptsourcethefacebookpluginfbScript.src="http://connect.facebook.net/en_US/all.js#xfbml=

javascript - Requirejs + Backbone 未捕获类型错误 : Cannot read property 'Model' of undefined

我从Backbone开始。我使用Require来加载模块并得到了这个错误。谁能解释一下?在文件user.js中,当我尝试创建Backbone.Model.extend时出现此错误。我使用了Backbone.js0.9.10、jQueryv1.9.0、RequireJS2.1.4、Underscore1.4.4。谢谢。index.html主要.jsrequire.config({paths:{jquery:'libs/jquery/jquery-min',underscore:'libs/underscore/underscore-min',backbone:'libs/backbone

javascript - Backbone.js 集合 fetch() 抛出未捕获的类型错误 : Cannot read property 'idAttribute' of undefined

我正在努力学习Backbone.js它可以获取、放置和删除单个模型。但是,当我创建一个集合时,fetch方法给出了这个错误:未捕获的类型错误:无法读取未定义的属性“idAttribute”(backbone.js:683)这是我正在尝试的代码:Person=Backbone.Model.extend({urlRoot:'/people'});PersonList=Backbone.Collection.extend({model:'Person',url:'/people'});varpersonList=newPersonList();personList.fetch();在获取时,