Skip to content

Commit 74c31e2

Browse files
committed
[js] Migrate typeObject_ to $$typeObject
1 parent bedbd44 commit 74c31e2

File tree

8 files changed

+24
-24
lines changed

8 files changed

+24
-24
lines changed

src/vm/js/nqp-runtime/core.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ op.bootarray = function() {
307307

308308
op.defined = function(obj) {
309309
// TODO - handle more things that aren't defined
310-
if (obj === Null || obj.typeObject_) {
310+
if (obj === Null || obj.$$typeObject) {
311311
return 0;
312312
}
313313
return 1;
@@ -504,19 +504,19 @@ op.iscont = function(cont) {
504504
};
505505

506506
op.iscont_i = function(cont) {
507-
if (cont.typeObject_) return 0;
507+
if (cont.$$typeObject) return 0;
508508
if (cont.$$iscont_i) return cont.$$iscont_i();
509509
return 0;
510510
};
511511

512512
op.iscont_n = function(cont) {
513-
if (cont.typeObject_) return 0;
513+
if (cont.$$typeObject) return 0;
514514
if (cont.$$iscont_n) return cont.$$iscont_n();
515515
return 0;
516516
};
517517

518518
op.iscont_s = function(cont) {
519-
if (cont.typeObject_) return 0;
519+
if (cont.$$typeObject) return 0;
520520
if (cont.$$iscont_s) {
521521
return cont.$$iscont_s();
522522
}
@@ -1705,7 +1705,7 @@ op.captureposprimspec = function(capture, idx) {
17051705
return 2;
17061706
} else if (capture.pos[idx] instanceof NativeStrArg) {
17071707
return 3;
1708-
} else if (capture.pos[idx].typeObject_) {
1708+
} else if (capture.pos[idx].$$typeObject) {
17091709
return 0;
17101710
} else {
17111711
return op.objprimspec(capture.pos[idx]);

src/vm/js/nqp-runtime/deserialization.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ class BinaryCursor {
784784
if (entry.type === 0) {
785785
const origObj = this.sc.deps[entry.origSC].rootObjects[entry.origIndex];
786786
if (origObj._SC !== this.sc.deps[entry.origSC]) {
787-
const backup = origObj.typeObject_ ? origObj._STable.createTypeObject() : origObj.$$clone();
787+
const backup = origObj.$$typeObject ? origObj._STable.createTypeObject() : origObj.$$clone();
788788
conflicts.$$push(backup);
789789
conflicts.$$push(origObj);
790790
}

src/vm/js/nqp-runtime/multicache.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class MultiCache {
4545
if (obj._STable.REPR instanceof reprs.NativeRef) {
4646
types[i] = obj._STable;
4747
} else {
48-
if (deconted.typeObject_) {
48+
if (deconted.$$typeObject) {
4949
if (deconted._STable.typeObjectCachedAsRW === undefined) {
5050
deconted._STable.typeObjectCachedAsRW = {};
5151
}
@@ -58,7 +58,7 @@ class MultiCache {
5858
}
5959
}
6060
} else {
61-
types[i] = deconted.typeObject_ ? deconted : deconted._STable;
61+
types[i] = deconted.$$typeObject ? deconted : deconted._STable;
6262
}
6363
} else if (obj instanceof NativeIntArg) {
6464
types[i] = 1;

src/vm/js/nqp-runtime/nfa.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ op.nfarunproto = function(nfa, target, pos) {
312312
op.nfarunalt = function(nfa, target, pos, bstackWrapped, cstackWrapped, marksWrapped) {
313313
let cstack;
314314

315-
if (cstackWrapped !== Null && !cstackWrapped.typeObject_) {
315+
if (cstackWrapped !== Null && !cstackWrapped.$$typeObject) {
316316
cstack = cstackWrapped.$$toArray();
317317
}
318318
const bstack = bstackWrapped.$$toArray();

src/vm/js/nqp-runtime/reprs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ class P6opaque extends REPRWithAttributes {
546546
'}\n');
547547

548548
if (this.autoVivValues && this.autoVivValues[slot] !== Null) {
549-
const isTypeObject = this.autoVivValues[slot].typeObject_;
549+
const isTypeObject = this.autoVivValues[slot].$$typeObject;
550550

551551
STable.compileAccessor('$$getattr$' + slot, 'function(value) {\n' +
552552
'var value = this.' + attr + ';\n' +
@@ -2078,7 +2078,7 @@ class MultiDimArray extends REPR {
20782078
setupSTable(STable) {
20792079
STable.addInternalMethods(class {
20802080
$$numdimensions(value) {
2081-
if (this.typeObject_) {
2081+
if (this.$$typeObject) {
20822082
throw new NQPException('Cannot get number of dimensions of a type object');
20832083
}
20842084
return STable.dimensions;
@@ -2092,7 +2092,7 @@ class MultiDimArray extends REPR {
20922092
}
20932093

20942094
$$dimensions() {
2095-
if (this.typeObject_) {
2095+
if (this.$$typeObject) {
20962096
throw new NQPException('Cannot get dimensions of a type object');
20972097
}
20982098
return BOOT.createIntArray(this.dimensions);

src/vm/js/nqp-runtime/runtime.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ exports.toStr = /*async*/ function(arg_, ctx) {
287287
return '';
288288
} else if (arg === nullStr) {
289289
return arg;
290-
} else if (arg.typeObject_) {
290+
} else if (arg.$$typeObject) {
291291
return '';
292292
} else if (arg.$$getStr) {
293293
return arg.$$getStr();
@@ -321,7 +321,7 @@ exports.toNum = /*async*/ function(arg_, ctx) {
321321
} else {
322322
throw new NQPException('we can\'t numify result of toNum');
323323
}
324-
} else if (arg.typeObject_) {
324+
} else if (arg.$$typeObject) {
325325
return 0;
326326
} else if (arg.$$getNum) {
327327
return arg.$$getNum();

src/vm/js/nqp-runtime/serialization.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ class SerializationWriter {
373373
const sc = ref[0];
374374
const scIdx = ref[1];
375375

376-
let packed = !obj.typeObject_ ? OBJECTS_TABLE_ENTRY_IS_CONCRETE : 0;
376+
let packed = !obj.$$typeObject ? OBJECTS_TABLE_ENTRY_IS_CONCRETE : 0;
377377

378378
if (sc <= OBJECTS_TABLE_ENTRY_SC_MAX && scIdx <= OBJECTS_TABLE_ENTRY_SC_IDX_MAX) {
379379
packed |= (sc << OBJECTS_TABLE_ENTRY_SC_SHIFT) | scIdx;
@@ -390,7 +390,7 @@ class SerializationWriter {
390390

391391

392392
/* Delegate to its serialization REPR function. */
393-
if (!obj.typeObject_) {
393+
if (!obj.$$typeObject) {
394394
if (!obj._STable.REPR.serialize) {
395395
console.trace(`don't know how to serialize ${obj._STable.REPR.name}`);
396396
} else {

src/vm/js/nqp-runtime/sixmodel.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class STable {
8484

8585
/* Default boolification mode 5 */
8686
this.ObjConstructor.prototype.$$toBool = function(ctx) {
87-
return this.typeObject_ ? 0 : 1;
87+
return this.$$typeObject ? 0 : 1;
8888
};
8989

9090
this.ObjConstructor.prototype.$$decont = function(ctx) {
@@ -95,7 +95,7 @@ class STable {
9595
return 0;
9696
};
9797

98-
this.ObjConstructor.prototype.typeObject_ = 0;
98+
this.ObjConstructor.prototype.$$typeObject = 0;
9999

100100
this.ObjConstructor.prototype.$$call = undefined;
101101

@@ -170,27 +170,27 @@ class STable {
170170
};
171171
} else if (mode == 1) {
172172
this.ObjConstructor.prototype.$$toBool = function(ctx) {
173-
return this.typeObject_ || this.$$getInt() == 0 ? 0 : 1;
173+
return this.$$typeObject || this.$$getInt() == 0 ? 0 : 1;
174174
};
175175
} else if (mode == 2) {
176176
this.ObjConstructor.prototype.$$toBool = function(ctx) {
177-
return this.typeObject_ || this.$$getNum() == 0 ? 0 : 1;
177+
return this.$$typeObject || this.$$getNum() == 0 ? 0 : 1;
178178
};
179179
} else if (mode == 3) {
180180
this.ObjConstructor.prototype.$$toBool = function(ctx) {
181-
return this.typeObject_ || this.$$getStr() == '' ? 0 : 1;
181+
return this.$$typeObject || this.$$getStr() == '' ? 0 : 1;
182182
};
183183
} else if (mode == 4) {
184184
this.ObjConstructor.prototype.$$toBool = function(ctx) {
185-
if (this.typeObject_) return 0;
185+
if (this.$$typeObject) return 0;
186186
const str = this.$$getStr();
187187
return (str == '' || str == '0') ? 0 : 1;
188188
};
189189
} else if (mode == 5) {
190190
// this is the default - do nothing
191191
} else if (mode == 6) {
192192
this.ObjConstructor.prototype.$$toBool = function(ctx) {
193-
return (this.typeObject_ || JSBI.equal(this.$$getBignum(), ZERO)) ? 0 : 1;
193+
return (this.$$typeObject || JSBI.equal(this.$$getBignum(), ZERO)) ? 0 : 1;
194194
};
195195
} else if (mode == 7) {
196196
// STUB
@@ -243,7 +243,7 @@ class STable {
243243

244244
createTypeObject() {
245245
const obj = new this.ObjConstructor();
246-
obj.typeObject_ = 1;
246+
obj.$$typeObject = 1;
247247
obj.$$atkey = function(key) {
248248
return Null;
249249
};

0 commit comments

Comments
 (0)