javascript - 用于初始化对象的 node.js 中的意外令牌 =
问题描述
我想在 node.js javascript 中使用一个对象将 Telnet 命令和选项映射到它的整数值:
MudSocket = class MudSocket extends TelnetSocket {
tel = { opt2num:
^ here is the error "unexpected Token"
{ IAC: "255",
DONT: "254", // and so on
},}
Visual Studio 代码编辑器没有显示任何错误,我尝试了 :, : Object (Error:only valid for typescript) 和 this.(Error: Unexpected Token again for this) 的前缀。
解决方案
推荐阅读
- java - 如何解决将 Java 8 代码迁移到 Java 11 的依赖项和包问题
- c# - 为什么 webbrowser 在 Visual Studio 2019 中不起作用?
- firebase-storage - 如何在一个文件中描述多个存储桶的 Firebase 存储安全规则?
- opc-ua - 有没有办法在 OPC-UA 中创建自定义数据类型的数组?
- javascript - 箭头在圆动画的外半径上旋转
- javascript - Javascript 错误:找不到导入的模块
- java - 反序列化嵌套的 Json 数组
- android - Android lint - 在 Android Studio 上禁用了应用快速修复按钮
- amazon-web-services - AWS CloudFront - 如何使用单个 CloudFront 和 SSL 服务多个来源
- javascript - Safari ReferenceError:找不到变量 - 发生了什么