草庐IT

is_nothrow_constructible

全部标签

javascript - 错误 TS2539 : Cannot assign to 'c' because it is not a variable

我有2个.ts文件,C.ts:exportletc:any=10;A.ts:import{c}from"./C";c=100;编译A.ts时报错:errorTS2539:Cannotassignto'c'becauseitisnotavariable.我该如何解决? 最佳答案 将它放在一个类中,并使其成为静态的exportclassGlobalVars{publicstaticc:any=10;}从任何其他文件导入之后GlobalVars.c=100; 关于javascript-错误TS

javascript - "Class extends value #<Object> is not a constructor or null"

感谢阅读我的文章我的代码出现此错误:“Classextendsvalue#isnotaconstructorornull”这是我的代码,我正在尝试导出/导入类。怪物.js:constminiMonster=require("./minimonster.js");classmonster{constructor(options={name},health){this.options=options;this.health=100;this.heal=()=>{return(this.health+=10);};}}letbigMonster=newmonster("Godzilla");

javascript - 安装 visual Studio 2015 社区版后,Crystal Reports 13 bobj is undefined JavaScript 错误

在带有CrystalReport13的VisualStudio2010中,我的项目运行良好。在我安装Visualstudio2015社区版之后供我个人使用。当我打开我的项目并在VisualStudio2010中运行时,它抛出“JavaScript运行时错误:‘bobj’未定义”。我浏览了一些网站http://www.mahadera.com/error-0x800a1391-javascript-runtime-error-bobj-is-undefined/http://www.aspsnippets.com/Articles/Crystal-Reports-13-Visual-St

javascript - Uncaught ReferenceError : Worker is not defined while trying to create a Worker within another Worker in Chrome

这link说:Workersmayspawnmoreworkersiftheywish.So-calledsub-workersmustbehostedwithinthesameoriginastheparentpage.Also,theURIsforsubworkersareresolvedrelativetotheparentworker'slocationratherthanthatoftheowningpage.Thismakesiteasierforworkerstokeeptrackofwheretheirdependenciesare.但是当我尝试在另一个Worker中创

javascript - 请求动画帧 : what exactly is the timestamp?

我一直认为requestAnimationFrame使用的时间戳和JavaScript中常用的时间戳是一样的,就是从1970年1月1日开始的毫秒数,今天抓取时间戳验证了一下,发现RAF时间戳大概是从1970年1月1日开始算起的页面加载的开始。时间戳的精确测量依据是什么?测试代码:vari=0;varstart=null;vartimes=[];vardur=5000;functionstep(timestamp){if(start===null)start=timestamp;times[i++]=timestamp;if(timestamp-start');}}requestAnim

javascript - 未捕获的类型错误 : lang is not a function

这个问题在这里已经有了答案:JSfunctionnamed`animate`doesn'tworkinChrome,butworksinIE(3个答案)关闭6年前。在我的HTML中,我在script标签中定义了lang函数并添加了“TestFire!”单击时必须调用lang的按钮:TestingFunctionsfunctionlang(){alert("Hello,World!It'sJavaScriptthistime");}但是,如果我点击按钮,我会得到这个错误:UncaughtTypeError:langisnotafunction但是,如果我将函数名称从lang更改为任何其他

javascript - 类型错误 : scrollIntoView is not a function

我是react-testing-library/jest的新手,正在尝试编写测试以查看路由导航(使用react-router-dom)是否正确执行。到目前为止,我一直在关注README还有这个tutorial关于如何使用。我的一个组件在本地函数中使用了scrollIntoView,这导致测试失败。TypeError:this.messagesEnd.scrollIntoViewisnotafunction45|46|scrollToBottom=()=>{>47|this.messagesEnd.scrollIntoView({behavior:"smooth"});|^48|}49|

javascript - d3 : what is the self as in d3. select(self.frameElement).style ("height", height + "px");

我在许多D3示例中看到过如下语句。但是,我无法找出它的含义。特别是,我不知道这个self变量指的是什么。此外,这是否体现了某种D3魔术/惯例,或者它只是一个临时的东西?非常感谢。d3.select(self.frameElement).style("height",height+"px");顺便说一句,here是我复制上面语句的例子。 最佳答案 self:如果没有重新定义(通常作为this的副本),那么它就是始终指向windowwindow对象。因此它们可以互换使用。window.frameElement:返回嵌入窗口的元素(例如或

javascript - 无效值错误 : initAutocomplete is not a function Google Places and Autocomplete API

希望您能提供帮助,因为我遇到了困难,我对使用Google的PlacesAPI也很陌生。我现在不打算发布任何代码,因为当我将要描述的2部分独立运行时,我的代码工作正常。除了使用Google提供的Javascript示例的自动完成API之外,我还使用Google的Places。最初我的文档底部有以下脚本:我文档顶部的这个脚本:这让我想到,“您已在此页面上多次包含GoogleMapsAPI。这可能会导致意外错误。”所以在研究了这个之后,我像这样将两者合并在一起:但是,既然我已经这样做了,我会收到以下错误:InvalidValueError:initAutocompleteisnotafunc

javascript - '类型错误 : undefined is not a function' when jumping 'tween modules

我在Node中不断遇到这个问题,每当我相互调用函数时,我的应用程序就会崩溃。我已经做了这个最小的工作示例(按照它的方式工作给了我错误):启动模块varmodule2=require('./module2');vardata='data';module2.doStuff(data);模块2varmodule3=require('./module3');functiondoStuff(data){//Stuffhappensto'data'module3.takeStuff(data);}functiondoSomethingElse(data){console.log(data);}mo