OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function(global, utils) { | 5 (function(global, utils) { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
11 | |
12 // ------------------------------------------------------------------- | 11 // ------------------------------------------------------------------- |
13 // Imports | 12 // Imports |
14 | 13 |
15 var GlobalArrayBuffer = global.ArrayBuffer; | 14 var GlobalArrayBuffer = global.ArrayBuffer; |
16 var GlobalObject = global.Object; | 15 var GlobalObject = global.Object; |
17 | 16 |
18 var MathMax; | 17 var MathMax; |
19 var MathMin; | 18 var MathMin; |
20 | 19 |
21 utils.Import(function(from) { | 20 utils.Import(function(from) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 %SetCode(GlobalArrayBuffer, ArrayBufferConstructor); | 87 %SetCode(GlobalArrayBuffer, ArrayBufferConstructor); |
89 %FunctionSetPrototype(GlobalArrayBuffer, new GlobalObject()); | 88 %FunctionSetPrototype(GlobalArrayBuffer, new GlobalObject()); |
90 | 89 |
91 // Set up the constructor property on the ArrayBuffer prototype object. | 90 // Set up the constructor property on the ArrayBuffer prototype object. |
92 %AddNamedProperty( | 91 %AddNamedProperty( |
93 GlobalArrayBuffer.prototype, "constructor", GlobalArrayBuffer, DONT_ENUM); | 92 GlobalArrayBuffer.prototype, "constructor", GlobalArrayBuffer, DONT_ENUM); |
94 | 93 |
95 %AddNamedProperty(GlobalArrayBuffer.prototype, | 94 %AddNamedProperty(GlobalArrayBuffer.prototype, |
96 symbolToStringTag, "ArrayBuffer", DONT_ENUM | READ_ONLY); | 95 symbolToStringTag, "ArrayBuffer", DONT_ENUM | READ_ONLY); |
97 | 96 |
98 $installGetter(GlobalArrayBuffer.prototype, "byteLength", ArrayBufferGetByteLen)
; | 97 utils.InstallGetter(GlobalArrayBuffer.prototype, "byteLength", ArrayBufferGetByt
eLen); |
99 | 98 |
100 $installFunctions(GlobalArrayBuffer, DONT_ENUM, [ | 99 utils.InstallFunctions(GlobalArrayBuffer, DONT_ENUM, [ |
101 "isView", ArrayBufferIsViewJS | 100 "isView", ArrayBufferIsViewJS |
102 ]); | 101 ]); |
103 | 102 |
104 $installFunctions(GlobalArrayBuffer.prototype, DONT_ENUM, [ | 103 utils.InstallFunctions(GlobalArrayBuffer.prototype, DONT_ENUM, [ |
105 "slice", ArrayBufferSlice | 104 "slice", ArrayBufferSlice |
106 ]); | 105 ]); |
107 | 106 |
108 }) | 107 }) |
OLD | NEW |