写了个简单的示例代码

auto.waitFor(); 

class User {
    constructor(id, name) {
        this.id = id
        this.name = name
    }
    Getid() {
        return this.id
    }
    Getname() {
        return this.name
    }
}

let 张三 = new User(123, '张三')
toastLog(张三.Getid())

运行后报错,日志提示identifier is a reserved word

已存档
逆袭的小飞棍
17
· 2 年前

回答

神秘机师
251
· 2 年前

暂未支持,可以考虑用 VSCode 配合插件,然后自行 babel 转换下

逆袭的小飞棍
17
· 2 年前

问一下官方能否加入对自定义类的支持

BATU1579
455
· 2 年前

可以用 hamibot-starter 把 ES6 转换为 ES5