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 // ------------------------------------------------------------------- | 11 // ------------------------------------------------------------------- |
12 // Imports | 12 // Imports |
13 | 13 |
14 var GlobalArrayBuffer = global.ArrayBuffer; | 14 var GlobalArrayBuffer = global.ArrayBuffer; |
15 var GlobalObject = global.Object; | 15 var GlobalObject = global.Object; |
16 var MathMax; | 16 var MathMax; |
17 var MathMin; | 17 var MathMin; |
18 var ToNumber; | 18 var ToNumber; |
| 19 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
19 | 20 |
20 utils.Import(function(from) { | 21 utils.Import(function(from) { |
21 MathMax = from.MathMax; | 22 MathMax = from.MathMax; |
22 MathMin = from.MathMin; | 23 MathMin = from.MathMin; |
23 ToNumber = from.ToNumber; | 24 ToNumber = from.ToNumber; |
24 }); | 25 }); |
25 | 26 |
26 // ------------------------------------------------------------------- | 27 // ------------------------------------------------------------------- |
27 | 28 |
28 function ArrayBufferConstructor(length) { // length = 1 | 29 function ArrayBufferConstructor(length) { // length = 1 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 87 |
87 // Set up the ArrayBuffer constructor function. | 88 // Set up the ArrayBuffer constructor function. |
88 %SetCode(GlobalArrayBuffer, ArrayBufferConstructor); | 89 %SetCode(GlobalArrayBuffer, ArrayBufferConstructor); |
89 %FunctionSetPrototype(GlobalArrayBuffer, new GlobalObject()); | 90 %FunctionSetPrototype(GlobalArrayBuffer, new GlobalObject()); |
90 | 91 |
91 // Set up the constructor property on the ArrayBuffer prototype object. | 92 // Set up the constructor property on the ArrayBuffer prototype object. |
92 %AddNamedProperty( | 93 %AddNamedProperty( |
93 GlobalArrayBuffer.prototype, "constructor", GlobalArrayBuffer, DONT_ENUM); | 94 GlobalArrayBuffer.prototype, "constructor", GlobalArrayBuffer, DONT_ENUM); |
94 | 95 |
95 %AddNamedProperty(GlobalArrayBuffer.prototype, | 96 %AddNamedProperty(GlobalArrayBuffer.prototype, |
96 symbolToStringTag, "ArrayBuffer", DONT_ENUM | READ_ONLY); | 97 toStringTagSymbol, "ArrayBuffer", DONT_ENUM | READ_ONLY); |
97 | 98 |
98 utils.InstallGetter(GlobalArrayBuffer.prototype, "byteLength", ArrayBufferGetByt
eLen); | 99 utils.InstallGetter(GlobalArrayBuffer.prototype, "byteLength", |
| 100 ArrayBufferGetByteLen); |
99 | 101 |
100 utils.InstallFunctions(GlobalArrayBuffer, DONT_ENUM, [ | 102 utils.InstallFunctions(GlobalArrayBuffer, DONT_ENUM, [ |
101 "isView", ArrayBufferIsViewJS | 103 "isView", ArrayBufferIsViewJS |
102 ]); | 104 ]); |
103 | 105 |
104 utils.InstallFunctions(GlobalArrayBuffer.prototype, DONT_ENUM, [ | 106 utils.InstallFunctions(GlobalArrayBuffer.prototype, DONT_ENUM, [ |
105 "slice", ArrayBufferSlice | 107 "slice", ArrayBufferSlice |
106 ]); | 108 ]); |
107 | 109 |
108 }) | 110 }) |
OLD | NEW |