Tag: typescript ecmascript 6

debugginges6代理为属性 – >内部错误:非法访问

如果我在node.js 6.6中编写(或从TypeScript转换)类: class Table { constructor(args) { this._rows = new Proxy({ test: 42 }, {}); } } 并像这样实例化它: var table = new Table(); 当我在Visual Studio代码1.2.1中debugging时,我想观看var table,我总是有 内部错误:非法访问 写在那里,这意味着我不能看表或其任何属性。 同样的事情在Chrome中运行得非常好。 那么,为什么呢?我能做些什么呢? 谢谢!

如何使用TypeScript 1.6与Visual Studio代码来获得生成器的支持?

我一直在Visual Studio Code中定位ES6,但是当我尝试切换到TypeScript时,它会抛出如下错误: 生成器仅在定位ECMAScript 6时可用 但是我的tsconfig.json确实有ES6目标: { "compilerOptions": { "target": "ES6", "module": "amd", "sourceMap": true } } 所以我试了npm install -g typescript@1.6.0-beta typescript@1.6.0-beta,但是看起来VSCode并不在意。 发电机目前不支持。 我怎样才能让TypeScript和生成器在VS Code中一起正常工作? 更新 将typescript.tsdk更改为1.6二进制文件似乎可以修复IntelliSense错误,但是这个tasks.json仍然会打印出error TS1220: Generators are only available when targeting ECMAScript 6 or higher. : "version": "0.1.0", "command": "/usr/local/lib/node_modules/typescript/bin/tsc", "showOutput": "silent", "windows": {"command": "tsc.exe"}, "isShellCommand": true, "args": ["app.ts"], "problemMatcher": "$tsc" 但是,在terminal中手动使用的/usr/local/lib/node_modules/typescript/bin/tsc […]