@@ -313,3 +313,57 @@ globalScope["trace"] = function(message, n) {
313
313
if ( n ) message += Array . prototype . slice . call ( arguments , 2 , 2 + n ) ;
314
314
console . error ( "trace: " + message ) ;
315
315
} ;
316
+
317
+ Object . defineProperty ( Int8Array , "wrap" , {
318
+ value : function wrap ( buffer , byteOffset , length ) {
319
+ return new Int8Array ( buffer , byteOffset , length ) ;
320
+ }
321
+ } ) ;
322
+
323
+ Object . defineProperty ( Uint8Array , "wrap" , {
324
+ value : function wrap ( buffer , byteOffset , length ) {
325
+ return new Uint8Array ( buffer , byteOffset , length ) ;
326
+ }
327
+ } ) ;
328
+
329
+ Object . defineProperty ( Uint8ClampedArray , "wrap" , {
330
+ value : function wrap ( buffer , byteOffset , length ) {
331
+ return new Uint8ClampedArray ( buffer , byteOffset , length ) ;
332
+ }
333
+ } ) ;
334
+
335
+ Object . defineProperty ( Int16Array , "wrap" , {
336
+ value : function wrap ( buffer , byteOffset , length ) {
337
+ return new Int16Array ( buffer , byteOffset , length ) ;
338
+ }
339
+ } ) ;
340
+
341
+ Object . defineProperty ( Uint16Array , "wrap" , {
342
+ value : function wrap ( buffer , byteOffset , length ) {
343
+ return new Uint16Array ( buffer , byteOffset , length ) ;
344
+ }
345
+ } ) ;
346
+
347
+ Object . defineProperty ( Int32Array , "wrap" , {
348
+ value : function wrap ( buffer , byteOffset , length ) {
349
+ return new Int32Array ( buffer , byteOffset , length ) ;
350
+ }
351
+ } ) ;
352
+
353
+ Object . defineProperty ( Uint32Array , "wrap" , {
354
+ value : function wrap ( buffer , byteOffset , length ) {
355
+ return new Uint32Array ( buffer , byteOffset , length ) ;
356
+ }
357
+ } ) ;
358
+
359
+ Object . defineProperty ( Float32Array , "wrap" , {
360
+ value : function wrap ( buffer , byteOffset , length ) {
361
+ return new Float32Array ( buffer , byteOffset , length ) ;
362
+ }
363
+ } ) ;
364
+
365
+ Object . defineProperty ( Float64Array , "wrap" , {
366
+ value : function wrap ( buffer , byteOffset , length ) {
367
+ return new Float64Array ( buffer , byteOffset , length ) ;
368
+ }
369
+ } ) ;
0 commit comments