• Home
  • Raw
  • Download

Lines Matching full:new

41     it("new Object", function () {
42 let insns = compileMainSnippet("new Object");
43 IRNode.pg = new PandaGen("", creatAstFromSnippet("new Object"), 0, undefined);
44 let arg0 = new VReg();
46 new Tryldglobalbyname(new Imm(0), "Object"),
47 new Sta(arg0),
49 new Newobjrange(new Imm(1), new Imm(1), [arg0]),
51 new Returnundefined()
57 it("new Object()", function () {
58 let insns = compileMainSnippet("new Object()");
59 IRNode.pg = new PandaGen("", creatAstFromSnippet("new Object()"), 0, undefined);
60 let arg0 = new VReg();
63 new Tryldglobalbyname(new Imm(0), "Object"),
64 new Sta(arg0),
66 new Newobjrange(new Imm(1), new Imm(1), [arg0]),
68 new Returnundefined()
74 it("new Object(2)", function () {
75 let insns = compileMainSnippet("new Object(2)");
76 IRNode.pg = new PandaGen("", creatAstFromSnippet("new Object(2)"), 0, undefined);
77 let arg0 = new VReg();
78 let arg1 = new VReg();
81 new Tryldglobalbyname(new Imm(0), "Object"),
82 new Sta(arg0),
84 new Ldai(new Imm(2)),
85 new Sta(arg1),
87 new Newobjrange(new Imm(1), new Imm(2), [arg0, arg1]),
89 new Returnundefined()
95 it("new obj.ctor()", function () {
96 let insns = compileMainSnippet("let obj; new obj.ctor()");
97 IRNode.pg = new PandaGen("", creatAstFromSnippet("let obj; new obj.ctor()"), 0, undefined);
99 let obj = new VReg();
100 let arg0 = new VReg();
101 let temp = new VReg();
104 new Tryldglobalbyname(new Imm(0), 'obj'),
105 new Sta(temp),
107 new Lda(obj),
108 new Ldobjbyname(new Imm(1), "ctor"),
109 new Sta(arg0),
111 new Newobjrange(new Imm(3), new Imm(1), [arg0]),
118 it("new Object(...args)", function () {
119 let insns = compileMainSnippet(`new Object(...args);`);
120 IRNode.pg = new PandaGen("", creatAstFromSnippet("new Object(...args);"), 0, undefined);
121 let arg0 = new VReg();
122 let elemIdxReg = new VReg();
123 let arrayInstance = new VReg();
126 new Tryldglobalbyname(new Imm(0), "Object"),
127 new Sta(arg0),
129 new Createemptyarray(new Imm(1)),
130 new Sta(arrayInstance),
131 new Ldai(new Imm(0)),
132 new Sta(elemIdxReg),
134 new Tryldglobalbyname(new Imm(2), "args"),
135 new Starrayspread(arrayInstance, elemIdxReg),
136 new Sta(elemIdxReg),
137 new Lda(arrayInstance),
139 new Newobjapply(new Imm(3), arg0),
141 new Returnundefined()