MCPcopy Create free account
hub / github.com/GamerHack/GamerHack.github.io / VariableMixin

Function VariableMixin

g2all/900/module/view.js:131–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131const VariableMixin = superclass => class extends superclass {
132 constructor(value=0) {
133 // unlike the View classes, we don't allow number coercion. we
134 // explicitly allow floats unlike Int
135 if (typeof value !== 'number') {
136 throw TypeError('value not a number');
137 }
138 super([value]);
139 }
140
141 addr_at(...args) {
142 throw TypeError('unimplemented method');
143 }
144
145 [Symbol.toPrimitive](hint) {
146 return this[0];
147 }
148
149 toString(...args) {
150 return this[0].toString(...args);
151 }
152};
153
154export class Byte extends VariableMixin(View1) {}
155export class Short extends VariableMixin(View2) {}

Callers 3

ByteClass · 0.70
ShortClass · 0.70
WordClass · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected