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

Unified Diff: src/typedarray.js

Issue 17904007: Do not allow invocation of ArrayBuffer and array buffer views' constructors as functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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/messages.js ('k') | test/mjsunit/external-array.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/typedarray.js
diff --git a/src/typedarray.js b/src/typedarray.js
index b14d65f0f6cda8a95ba46291fcadd87bd92fb487..0d903550495be2a6d792d279b547e7229ebf4ce5 100644
--- a/src/typedarray.js
+++ b/src/typedarray.js
@@ -97,7 +97,7 @@ function CreateTypedArrayConstructor(name, elementSize, arrayId, constructor) {
throw MakeTypeError("parameterless_typed_array_constr", [name]);
}
} else {
- return new constructor(arg1, arg2, arg3);
+ throw MakeTypeError("constructor_not_function", [name])
}
}
}
@@ -223,7 +223,7 @@ function DataViewConstructor(buffer, byteOffset, byteLength) { // length = 3
}
%DataViewInitialize(this, buffer, offset, length);
} else {
- return new $DataView(buffer, byteOffset, byteLength)
+ throw MakeTypeError('constructor_not_function', ["DataView"]);
}
}
« no previous file with comments | « src/messages.js ('k') | test/mjsunit/external-array.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698