Revision f230a1cf deps/v8/src/typedarray.js

View differences:

deps/v8/src/typedarray.js
30 30
// This file relies on the fact that the following declaration has been made
31 31
// in runtime.js:
32 32
// var $Array = global.Array;
33

  
33
var $ArrayBuffer = global.ArrayBuffer;
34 34

  
35 35

  
36 36
// --------------- Typed Arrays ---------------------
......
70 70
  function ConstructByLength(obj, length) {
71 71
    var l = ToPositiveInteger(length, "invalid_typed_array_length");
72 72
    var byteLength = l * elementSize;
73
    var buffer = new global.ArrayBuffer(byteLength);
73
    var buffer = new $ArrayBuffer(byteLength);
74 74
    %TypedArrayInitialize(obj, arrayId, buffer, 0, byteLength);
75 75
  }
76 76

  
77 77
  function ConstructByArrayLike(obj, arrayLike) {
78 78
    var length = arrayLike.length;
79
    var l =  ToPositiveInteger(length, "invalid_typed_array_length");
79
    var l = ToPositiveInteger(length, "invalid_typed_array_length");
80 80
    if(!%TypedArrayInitializeFromArrayLike(obj, arrayId, arrayLike, l)) {
81 81
      for (var i = 0; i < l; i++) {
82
        // It is crucial that we let any execptions from arrayLike[i]
83
        // propagate outside the function.
82 84
        obj[i] = arrayLike[i];
83 85
      }
84 86
    }

Also available in: Unified diff