| 37 | |
| 38 | function ViewMixin(superclass) { |
| 39 | const res = class extends superclass { |
| 40 | constructor(...args) { |
| 41 | super(...args); |
| 42 | this.buffer; |
| 43 | } |
| 44 | |
| 45 | get addr() { |
| 46 | let res = this._addr_cache; |
| 47 | if (res !== undefined) { |
| 48 | return res; |
| 49 | } |
| 50 | res = mt.get_view_vector(this); |
| 51 | this._addr_cache = res; |
| 52 | return res; |
| 53 | } |
| 54 | |
| 55 | get size() { |
| 56 | return this.byteLength; |
| 57 | } |
| 58 | |
| 59 | addr_at(index) { |
| 60 | const size = this.BYTES_PER_ELEMENT; |
| 61 | return this.addr.add(index * size); |
| 62 | } |
| 63 | |
| 64 | sget(index) { |
| 65 | return this[index] | 0; |
| 66 | } |
| 67 | }; |
| 68 | |
| 69 | // workaround for known affected versions: ps4 [6.00, 10.00) |
| 70 | // |
nothing calls this directly
no outgoing calls
no test coverage detected