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

Unified Diff: src/typedarray.js

Issue 1136553006: Implement SharedArrayBuffer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: merge master Created 5 years, 7 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/runtime/runtime-typedarray.cc ('k') | test/cctest/test-api.cc » ('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 28d073aa2e0ab7488396fa6f65bc686f7d7c91e2..7c08fce555ce466acb966831c14c057ca110687b 100644
--- a/src/typedarray.js
+++ b/src/typedarray.js
@@ -127,7 +127,7 @@ function NAMEConstructByArrayLike(obj, arrayLike) {
function NAMEConstructor(arg1, arg2, arg3) {
if (%_IsConstructCall()) {
- if (IS_ARRAYBUFFER(arg1)) {
+ if (IS_ARRAYBUFFER(arg1) || IS_SHAREDARRAYBUFFER(arg1)) {
NAMEConstructByArrayBuffer(this, arg1, arg2, arg3);
} else if (IS_NUMBER(arg1) || IS_STRING(arg1) ||
IS_BOOLEAN(arg1) || IS_UNDEFINED(arg1)) {
@@ -347,6 +347,7 @@ TYPED_ARRAYS(SETUP_TYPED_ARRAY)
function DataViewConstructor(buffer, byteOffset, byteLength) { // length = 3
if (%_IsConstructCall()) {
+ // TODO(binji): support SharedArrayBuffers?
if (!IS_ARRAYBUFFER(buffer)) throw MakeTypeError(kDataViewNotArrayBuffer);
if (!IS_UNDEFINED(byteOffset)) {
byteOffset = $toPositiveInteger(byteOffset, kInvalidDataViewOffset);
« no previous file with comments | « src/runtime/runtime-typedarray.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698