Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Side by Side Diff: src/js/harmony-sharedarraybuffer.js

Issue 1404943002: Use import/export for more functions (instead of js builtins object). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/js/date.js ('k') | src/js/macros.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 var GlobalSharedArrayBuffer = global.SharedArrayBuffer; 11 var GlobalSharedArrayBuffer = global.SharedArrayBuffer;
12 var GlobalObject = global.Object; 12 var GlobalObject = global.Object;
13 var ToPositiveInteger;
13 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); 14 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
14 15
16 utils.Import(function(from) {
17 ToPositiveInteger = from.ToPositiveInteger;
18 })
19
15 // ------------------------------------------------------------------- 20 // -------------------------------------------------------------------
16 21
17 function SharedArrayBufferConstructor(length) { // length = 1 22 function SharedArrayBufferConstructor(length) { // length = 1
18 if (%_IsConstructCall()) { 23 if (%_IsConstructCall()) {
19 var byteLength = $toPositiveInteger(length, kInvalidArrayBufferLength); 24 var byteLength = ToPositiveInteger(length, kInvalidArrayBufferLength);
20 %ArrayBufferInitialize(this, byteLength, kShared); 25 %ArrayBufferInitialize(this, byteLength, kShared);
21 } else { 26 } else {
22 throw MakeTypeError(kConstructorNotFunction, "SharedArrayBuffer"); 27 throw MakeTypeError(kConstructorNotFunction, "SharedArrayBuffer");
23 } 28 }
24 } 29 }
25 30
26 function SharedArrayBufferGetByteLen() { 31 function SharedArrayBufferGetByteLen() {
27 if (!IS_SHAREDARRAYBUFFER(this)) { 32 if (!IS_SHAREDARRAYBUFFER(this)) {
28 throw MakeTypeError(kIncompatibleMethodReceiver, 33 throw MakeTypeError(kIncompatibleMethodReceiver,
29 'SharedArrayBuffer.prototype.byteLength', this); 34 'SharedArrayBuffer.prototype.byteLength', this);
(...skipping 18 matching lines...) Expand all
48 toStringTagSymbol, "SharedArrayBuffer", DONT_ENUM | READ_ONLY); 53 toStringTagSymbol, "SharedArrayBuffer", DONT_ENUM | READ_ONLY);
49 54
50 utils.InstallGetter(GlobalSharedArrayBuffer.prototype, "byteLength", 55 utils.InstallGetter(GlobalSharedArrayBuffer.prototype, "byteLength",
51 SharedArrayBufferGetByteLen); 56 SharedArrayBufferGetByteLen);
52 57
53 utils.InstallFunctions(GlobalSharedArrayBuffer, DONT_ENUM, [ 58 utils.InstallFunctions(GlobalSharedArrayBuffer, DONT_ENUM, [
54 "isView", SharedArrayBufferIsViewJS 59 "isView", SharedArrayBufferIsViewJS
55 ]); 60 ]);
56 61
57 }) 62 })
OLDNEW
« no previous file with comments | « src/js/date.js ('k') | src/js/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698