const { ccclass, property } = cc._decorator;

@ccclass
export default class Demo extends cc.Component {

    @property(cc.Label)
    label: cc.Label = null;

    start() {
        if (cc.director.getScene().name == "Demo1_Crash") {
            this.demo1();
        } else {
            this.demo2();
        }
    }

    /**模拟器运行会崩溃，无报错 */
    demo1() {
        let str: string = "qweqwewqee wqeqweqweqweeeeeeeeeeeeeeeee";
        this.label.string = str;
    }

    /**模拟器运行不会崩溃 */
    demo2() {
        let str: string = "qweqwewqee";
        this.label.string = str;
    }
}
