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

Unified Diff: src/arraybuffer.js

Issue 142813003: A64: Synchronize with r15358. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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/arm/macro-assembler-arm.cc ('k') | src/ast.h » ('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 2b0c3dd85b1107bc2f5a98d355a24ad7a974e9fe..4a4f570146568464dfe8938502e9a827be60c6cd 100644
--- a/src/arraybuffer.js
+++ b/src/arraybuffer.js
@@ -31,12 +31,12 @@ var $ArrayBuffer = global.ArrayBuffer;
// -------------------------------------------------------------------
-function ArrayBufferConstructor(byteLength) { // length = 1
+function ArrayBufferConstructor(length) { // length = 1
if (%_IsConstructCall()) {
- var l = TO_POSITIVE_INTEGER(byteLength);
- %ArrayBufferInitialize(this, l);
+ var byteLength = ToPositiveInteger(length, 'invalid_array_buffer_length');
+ %ArrayBufferInitialize(this, byteLength);
} else {
- return new $ArrayBuffer(byteLength);
+ throw MakeTypeError('constructor_not_function', ["ArrayBuffer"]);
}
}
@@ -70,6 +70,9 @@ function ArrayBufferSlice(start, end) {
fin = MathMin(relativeEnd, this.byteLength);
}
+ if (fin < first) {
+ fin = first;
+ }
var newLen = fin - first;
// TODO(dslomov): implement inheritance
var result = new $ArrayBuffer(newLen);
« no previous file with comments | « src/arm/macro-assembler-arm.cc ('k') | src/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698