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

Unified Diff: src/js/arraybuffer.js

Issue 1500543002: [es6] Unify ArrayBuffer and SharedArrayBuffer constructors. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Get the exceptions right. Other fixes. Created 4 years, 12 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/heap/heap.h ('k') | src/js/harmony-sharedarraybuffer.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/arraybuffer.js
diff --git a/src/js/arraybuffer.js b/src/js/arraybuffer.js
index 1e405638d582936b83461502706d0b6b9310f920..1ee68ca291b0ccc6c6affc79af5c7bcc6b90c493 100644
--- a/src/js/arraybuffer.js
+++ b/src/js/arraybuffer.js
@@ -12,31 +12,18 @@
// Imports
var GlobalArrayBuffer = global.ArrayBuffer;
-var GlobalObject = global.Object;
var MakeTypeError;
var MaxSimple;
var MinSimple;
-var ToPositiveInteger;
-var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
utils.Import(function(from) {
MakeTypeError = from.MakeTypeError;
MaxSimple = from.MaxSimple;
MinSimple = from.MinSimple;
- ToPositiveInteger = from.ToPositiveInteger;
});
// -------------------------------------------------------------------
-function ArrayBufferConstructor(length) { // length = 1
- if (!IS_UNDEFINED(new.target)) {
- var byteLength = ToPositiveInteger(length, kInvalidArrayBufferLength);
- %ArrayBufferInitialize(this, byteLength, kNotShared);
- } else {
- throw MakeTypeError(kConstructorNotFunction, "ArrayBuffer");
- }
-}
-
function ArrayBufferGetByteLen() {
if (!IS_ARRAYBUFFER(this)) {
throw MakeTypeError(kIncompatibleMethodReceiver,
@@ -82,29 +69,9 @@ function ArrayBufferSlice(start, end) {
return result;
}
-function ArrayBufferIsViewJS(obj) {
- return %ArrayBufferIsView(obj);
-}
-
-
-// Set up the ArrayBuffer constructor function.
-%SetCode(GlobalArrayBuffer, ArrayBufferConstructor);
-%FunctionSetPrototype(GlobalArrayBuffer, new GlobalObject());
-
-// Set up the constructor property on the ArrayBuffer prototype object.
-%AddNamedProperty(
- GlobalArrayBuffer.prototype, "constructor", GlobalArrayBuffer, DONT_ENUM);
-
-%AddNamedProperty(GlobalArrayBuffer.prototype,
- toStringTagSymbol, "ArrayBuffer", DONT_ENUM | READ_ONLY);
-
utils.InstallGetter(GlobalArrayBuffer.prototype, "byteLength",
ArrayBufferGetByteLen);
-utils.InstallFunctions(GlobalArrayBuffer, DONT_ENUM, [
- "isView", ArrayBufferIsViewJS
-]);
-
utils.InstallFunctions(GlobalArrayBuffer.prototype, DONT_ENUM, [
"slice", ArrayBufferSlice
]);
« no previous file with comments | « src/heap/heap.h ('k') | src/js/harmony-sharedarraybuffer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698