Commit 0957bd96 authored by Ben L. Titzer's avatar Ben L. Titzer Committed by Commit Bot

[wasm] Fix subclassing for WebAssembly.* types.

R=rossberg@chromium.org

Bug: chromium:772636
Change-Id: I885f8657eb755953be17d7bf32aef2629092b9c2
Reviewed-on: https://chromium-review.googlesource.com/733086Reviewed-by: 's avatarAndreas Rossberg <rossberg@chromium.org>
Commit-Queue: Ben Titzer <titzer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48830}
parent 271e3b10
......@@ -12829,6 +12829,10 @@ bool CanSubclassHaveInobjectProperties(InstanceType instance_type) {
case JS_VALUE_TYPE:
case JS_WEAK_MAP_TYPE:
case JS_WEAK_SET_TYPE:
case WASM_INSTANCE_TYPE:
case WASM_MEMORY_TYPE:
case WASM_MODULE_TYPE:
case WASM_TABLE_TYPE:
return true;
case BIGINT_TYPE:
......
......@@ -889,3 +889,17 @@ assertInstantiateSuccess(importingModuleBinary, {'': {f: () => {}}});
assertInstantiateSuccess(importingModuleBinary.buffer, {'': {f: () => {}}});
assertInstantiateSuccess(
memoryImportingModuleBinary, {'': {'my_memory': scratch_memory}});
(function TestSubclassing() {
class M extends WebAssembly.Module { }
assertThrows(() => new M());
class I extends WebAssembly.Instance { }
assertThrows(() => new I());
class T extends WebAssembly.Table { }
assertThrows(() => new T());
class Y extends WebAssembly.Memory { }
assertThrows(() => new Y());
})();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment