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

Unified Diff: src/arraybuffer.js

Issue 1088863002: Revert of Reland of Wrap typed array implementations in functions. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/array-iterator.js ('k') | src/bootstrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arraybuffer.js
diff --git a/src/arraybuffer.js b/src/arraybuffer.js
index 86b13927aa42071d091dbae4a200bbd9a5f8666b..e4d332b060cbc6d7be90d274a25e302898754078 100644
--- a/src/arraybuffer.js
+++ b/src/arraybuffer.js
@@ -2,14 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-(function() {
-
"use strict";
-%CheckIsBootstrapping();
-
-var GlobalArrayBuffer = global.ArrayBuffer;
-var GlobalObject = global.Object;
+var $ArrayBuffer = global.ArrayBuffer;
// -------------------------------------------------------------------
@@ -61,7 +56,7 @@
}
var newLen = fin - first;
// TODO(dslomov): implement inheritance
- var result = new GlobalArrayBuffer(newLen);
+ var result = new $ArrayBuffer(newLen);
%ArrayBufferSliceImpl(this, result, first);
return result;
@@ -71,26 +66,29 @@
return %ArrayBufferIsView(obj);
}
+function SetUpArrayBuffer() {
+ %CheckIsBootstrapping();
-// Set up the ArrayBuffer constructor function.
-%SetCode(GlobalArrayBuffer, ArrayBufferConstructor);
-%FunctionSetPrototype(GlobalArrayBuffer, new GlobalObject());
+ // Set up the ArrayBuffer constructor function.
+ %SetCode($ArrayBuffer, ArrayBufferConstructor);
+ %FunctionSetPrototype($ArrayBuffer, new $Object());
-// Set up the constructor property on the ArrayBuffer prototype object.
-%AddNamedProperty(
- GlobalArrayBuffer.prototype, "constructor", GlobalArrayBuffer, DONT_ENUM);
+ // Set up the constructor property on the ArrayBuffer prototype object.
+ %AddNamedProperty(
+ $ArrayBuffer.prototype, "constructor", $ArrayBuffer, DONT_ENUM);
-%AddNamedProperty(GlobalArrayBuffer.prototype,
- symbolToStringTag, "ArrayBuffer", DONT_ENUM | READ_ONLY);
+ %AddNamedProperty($ArrayBuffer.prototype,
+ symbolToStringTag, "ArrayBuffer", DONT_ENUM | READ_ONLY);
-InstallGetter(GlobalArrayBuffer.prototype, "byteLength", ArrayBufferGetByteLen);
+ InstallGetter($ArrayBuffer.prototype, "byteLength", ArrayBufferGetByteLen);
-InstallFunctions(GlobalArrayBuffer, DONT_ENUM, [
- "isView", ArrayBufferIsViewJS
-]);
+ InstallFunctions($ArrayBuffer, DONT_ENUM, [
+ "isView", ArrayBufferIsViewJS
+ ]);
-InstallFunctions(GlobalArrayBuffer.prototype, DONT_ENUM, [
- "slice", ArrayBufferSlice
-]);
+ InstallFunctions($ArrayBuffer.prototype, DONT_ENUM, [
+ "slice", ArrayBufferSlice
+ ]);
+}
-})();
+SetUpArrayBuffer();
« no previous file with comments | « src/array-iterator.js ('k') | src/bootstrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698