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

Unified Diff: src/builtins.cc

Issue 2126603003: [builtins] Migrate ArrayBufferPrototypeByteLength to C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comment with ES6 section Created 4 years, 5 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/builtins.h ('k') | src/js/arraybuffer.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 02a700574578e08a0deca80bdbddc6ea544be78e..30e3b822dff8e8560485d05bca2abeb590956963 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -5622,6 +5622,15 @@ BUILTIN(ArrayBufferConstructor_ConstructStub) {
return *result;
}
+// ES6 section 24.1.4.1 get ArrayBuffer.prototype.byteLength
+BUILTIN(ArrayBufferPrototypeGetByteLength) {
+ HandleScope scope(isolate);
+ CHECK_RECEIVER(JSArrayBuffer, array_buffer,
+ "get ArrayBuffer.prototype.byteLength");
+ // TODO(franzih): According to the ES6 spec, we should throw a TypeError
+ // here if the JSArrayBuffer is detached.
+ return array_buffer->byte_length();
+}
// ES6 section 24.1.3.1 ArrayBuffer.isView ( arg )
BUILTIN(ArrayBufferIsView) {
« no previous file with comments | « src/builtins.h ('k') | src/js/arraybuffer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698