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

Unified Diff: src/wasm/wasm-js.cc

Issue 2628053004: [wasm] JS-APIs: more WebAssembly.compile tests (Closed)
Patch Set: rebase Created 3 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 | « no previous file | test/mjsunit/wasm/js-api.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-js.cc
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc
index 732751610587bfb64d23563d36f5371e2d746a69..76abca0d44a748b52c0cdbfc105ea1b9ae096543 100644
--- a/src/wasm/wasm-js.cc
+++ b/src/wasm/wasm-js.cc
@@ -56,9 +56,6 @@ RawBuffer GetRawBufferSource(
start = reinterpret_cast<const byte*>(contents.Data());
end = start + contents.ByteLength();
- if (start == nullptr || end == start) {
- thrower->CompileError("ArrayBuffer argument is empty");
- }
} else if (source->IsTypedArray()) {
// A TypedArray was passed.
Local<TypedArray> array = Local<TypedArray>::Cast(source);
@@ -70,13 +67,12 @@ RawBuffer GetRawBufferSource(
reinterpret_cast<const byte*>(contents.Data()) + array->ByteOffset();
end = start + array->ByteLength();
- if (start == nullptr || end == start) {
- thrower->CompileError("ArrayBuffer argument is empty");
- }
} else {
thrower->TypeError("Argument 0 must be an ArrayBuffer or Uint8Array");
}
-
+ if (start == nullptr || end == start) {
+ thrower->CompileError("BufferSource argument is empty");
+ }
return {start, end};
}
« no previous file with comments | « no previous file | test/mjsunit/wasm/js-api.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698