Changeset 215664 in webkit


Ignore:
Timestamp:
Apr 22, 2017 12:52:03 AM (7 years ago)
Author:
jfbastien@apple.com
Message:

WebAssembly: Module.exports, Module.imports, Module.customSections are wrong
https://bugs.webkit.org/show_bug.cgi?id=171078

Reviewed by Saam Barati.

They're static properties of Module, not instance properties of a module.
https://github.com/WebAssembly/design/blob/master/JS.md#webassemblymoduleexports

JSTests:

  • wasm/js-api/Module.customSection.js:

(assert.throws.WebAssembly.Module.customSections):
(assert.eq):
(assert.throws.WebAssembly.Module.prototype.customSections): Deleted.

  • wasm/js-api/Module.exports.js:

(assert.throws.WebAssembly.Module.exports):
(assert.truthy):
(assert.throws.WebAssembly.Module.prototype.exports): Deleted.

  • wasm/js-api/Module.imports.js:

(assert.throws.WebAssembly.Module.imports):
(assert.truthy):
(assert.throws.WebAssembly.Module.prototype.imports): Deleted.

Source/JavaScriptCore:

  • wasm/js/WebAssemblyModuleConstructor.cpp:

(JSC::webAssemblyModuleCustomSections):
(JSC::webAssemblyModuleImports):
(JSC::webAssemblyModuleExports):

  • wasm/js/WebAssemblyModulePrototype.cpp:

(JSC::webAssemblyModuleProtoCustomSections): Deleted.
(JSC::webAssemblyModuleProtoImports): Deleted.
(JSC::webAssemblyModuleProtoExports): Deleted.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r215662 r215664  
     12017-04-22  JF Bastien  <jfbastien@apple.com>
     2
     3        WebAssembly: Module.exports, Module.imports, Module.customSections are wrong
     4        https://bugs.webkit.org/show_bug.cgi?id=171078
     5
     6        Reviewed by Saam Barati.
     7
     8        They're static properties of Module, not instance properties of a module.
     9        https://github.com/WebAssembly/design/blob/master/JS.md#webassemblymoduleexports
     10
     11        * wasm/js-api/Module.customSection.js:
     12        (assert.throws.WebAssembly.Module.customSections):
     13        (assert.eq):
     14        (assert.throws.WebAssembly.Module.prototype.customSections): Deleted.
     15        * wasm/js-api/Module.exports.js:
     16        (assert.throws.WebAssembly.Module.exports):
     17        (assert.truthy):
     18        (assert.throws.WebAssembly.Module.prototype.exports): Deleted.
     19        * wasm/js-api/Module.imports.js:
     20        (assert.throws.WebAssembly.Module.imports):
     21        (assert.truthy):
     22        (assert.throws.WebAssembly.Module.prototype.imports): Deleted.
     23
    1242017-04-21  JF Bastien  <jfbastien@apple.com>
    225
  • trunk/JSTests/wasm/js-api/Module.customSection.js

    r210282 r215664  
    22import * as assert from '../assert.js';
    33
    4 assert.throws(() => WebAssembly.Module.prototype.customSections(undefined, ""), TypeError, `WebAssembly.Module.prototype.customSections called with non WebAssembly.Module |this| value`);
     4assert.throws(() => WebAssembly.Module.customSections(undefined, ""), TypeError, `WebAssembly.Module.customSections called with non WebAssembly.Module argument`);
     5assert.eq(WebAssembly.Module.customSections.length, 2);
    56
    67{
    78    const empty = new WebAssembly.Module((new Builder()).WebAssembly().get());
    8     assert.isArray(empty.customSections(""));
    9     assert.eq(empty.customSections("").length, 0);
     9    assert.isArray(WebAssembly.Module.customSections(empty, ""));
     10    assert.eq(WebAssembly.Module.customSections(empty, "").length, 0);
    1011}
    1112
     
    1415        .Unknown("hello").Byte(0x00).Byte(0x42).Byte(0xFF).End()
    1516        .WebAssembly().get());
    16     assert.eq(single.customSections("").length, 0);
    17     const hello = single.customSections("hello");
     17    assert.eq(WebAssembly.Module.customSections(single, "").length, 0);
     18    const hello = WebAssembly.Module.customSections(single, "hello");
    1819    assert.eq(hello.length, 1);
    1920    assert.eq(hello[0].byteLength, 3);
     
    2829        .Unknown("👨‍❤️‍💋‍👨").Byte(42).End()
    2930        .WebAssembly().get());
    30     const family = unicode.customSections("👨‍❤️‍💋‍👨");
     31    const family = WebAssembly.Module.customSections(unicode, "👨‍❤️‍💋‍👨");
    3132    assert.eq(family.length, 1);
    3233    assert.eq(family[0].byteLength, 1);
     
    4445        .WebAssembly().get());
    4546
    46     const zero = many.customSections("zero");
     47    const zero = WebAssembly.Module.customSections(many, "zero");
    4748    assert.eq(zero.length, 1);
    4849    assert.eq(zero[0].byteLength, 1);
     
    5051    assert.eq(zeroI8[0], 0);
    5152
    52     const two = many.customSections("two");
     53    const two = WebAssembly.Module.customSections(many, "two");
    5354    assert.eq(two.length, 1);
    5455    assert.eq(two[0].byteLength, 4);
     
    5960    assert.eq(twoI8[3], 3);
    6061
    61     const one = many.customSections("one");
     62    const one = WebAssembly.Module.customSections(many, "one");
    6263    assert.eq(one.length, 3);
    6364    let seen = 0;
  • trunk/JSTests/wasm/js-api/Module.exports.js

    r214484 r215664  
    22import * as assert from '../assert.js';
    33
    4 assert.throws(() => WebAssembly.Module.prototype.exports(undefined, ""), TypeError, `WebAssembly.Module.prototype.exports called with non WebAssembly.Module |this| value`);
     4assert.throws(() => WebAssembly.Module.exports(undefined), TypeError, `WebAssembly.Module.exports called with non WebAssembly.Module argument`);
     5assert.eq(WebAssembly.Module.exports.length, 1);
    56
    67{
    78    const m = new WebAssembly.Module((new Builder()).WebAssembly().get());
    8     assert.isArray(m.exports);
    9     assert.eq(m.exports.length, 0);
    10     assert.truthy(m.exports !== m.exports);
     9    assert.isArray(WebAssembly.Module.exports(m));
     10    assert.eq(WebAssembly.Module.exports(m).length, 0);
     11    assert.truthy(WebAssembly.Module.exports(m) !== WebAssembly.Module.exports(m));
    1112}
    1213
     
    3132            .End()
    3233            .WebAssembly().get());
    33     assert.eq(m.exports.length, 4);
    34     assert.eq(m.exports[0].name, "func");
    35     assert.eq(m.exports[0].kind, "function");
    36     assert.eq(m.exports[1].name, "tab");
    37     assert.eq(m.exports[1].kind, "table");
    38     assert.eq(m.exports[2].name, "mem");
    39     assert.eq(m.exports[2].kind, "memory");
    40     assert.eq(m.exports[3].name, "glob");
    41     assert.eq(m.exports[3].kind, "global");
     34    assert.eq(WebAssembly.Module.exports(m).length, 4);
     35    assert.eq(WebAssembly.Module.exports(m)[0].name, "func");
     36    assert.eq(WebAssembly.Module.exports(m)[0].kind, "function");
     37    assert.eq(WebAssembly.Module.exports(m)[1].name, "tab");
     38    assert.eq(WebAssembly.Module.exports(m)[1].kind, "table");
     39    assert.eq(WebAssembly.Module.exports(m)[2].name, "mem");
     40    assert.eq(WebAssembly.Module.exports(m)[2].kind, "memory");
     41    assert.eq(WebAssembly.Module.exports(m)[3].name, "glob");
     42    assert.eq(WebAssembly.Module.exports(m)[3].kind, "global");
    4243}
  • trunk/JSTests/wasm/js-api/Module.imports.js

    r214484 r215664  
    22import * as assert from '../assert.js';
    33
    4 assert.throws(() => WebAssembly.Module.prototype.imports(undefined, ""), TypeError, `WebAssembly.Module.prototype.imports called with non WebAssembly.Module |this| value`);
     4assert.throws(() => WebAssembly.Module.imports(undefined), TypeError, `WebAssembly.Module.imports called with non WebAssembly.Module argument`);
     5assert.eq(WebAssembly.Module.imports.length, 1);
    56
    67{
    78    const m = new WebAssembly.Module((new Builder()).WebAssembly().get());
    8     assert.isArray(m.imports);
    9     assert.eq(m.imports.length, 0);
    10     assert.truthy(m.exports !== m.exports);
     9    assert.isArray(WebAssembly.Module.imports(m));
     10    assert.eq(WebAssembly.Module.imports(m).length, 0);
     11    assert.truthy(WebAssembly.Module.imports(m) !== WebAssembly.Module.imports(m));
    1112}
    1213
     
    2223            .End()
    2324            .WebAssembly().get());
    24     assert.eq(m.imports.length, 4);
    25     assert.eq(m.imports[0].module, "fooFunction");
    26     assert.eq(m.imports[0].name, "barFunction");
    27     assert.eq(m.imports[0].kind, "function");
    28     assert.eq(m.imports[1].module, "fooTable");
    29     assert.eq(m.imports[1].name, "barTable");
    30     assert.eq(m.imports[1].kind, "table");
    31     assert.eq(m.imports[2].module, "fooMemory");
    32     assert.eq(m.imports[2].name, "barMemory");
    33     assert.eq(m.imports[2].kind, "memory");
    34     assert.eq(m.imports[3].module, "fooGlobal");
    35     assert.eq(m.imports[3].name, "barGlobal");
    36     assert.eq(m.imports[3].kind, "global");
     25    assert.eq(WebAssembly.Module.imports(m).length, 4);
     26    assert.eq(WebAssembly.Module.imports(m)[0].module, "fooFunction");
     27    assert.eq(WebAssembly.Module.imports(m)[0].name, "barFunction");
     28    assert.eq(WebAssembly.Module.imports(m)[0].kind, "function");
     29    assert.eq(WebAssembly.Module.imports(m)[1].module, "fooTable");
     30    assert.eq(WebAssembly.Module.imports(m)[1].name, "barTable");
     31    assert.eq(WebAssembly.Module.imports(m)[1].kind, "table");
     32    assert.eq(WebAssembly.Module.imports(m)[2].module, "fooMemory");
     33    assert.eq(WebAssembly.Module.imports(m)[2].name, "barMemory");
     34    assert.eq(WebAssembly.Module.imports(m)[2].kind, "memory");
     35    assert.eq(WebAssembly.Module.imports(m)[3].module, "fooGlobal");
     36    assert.eq(WebAssembly.Module.imports(m)[3].name, "barGlobal");
     37    assert.eq(WebAssembly.Module.imports(m)[3].kind, "global");
    3738}
  • trunk/Source/JavaScriptCore/ChangeLog

    r215644 r215664  
     12017-04-22  JF Bastien  <jfbastien@apple.com>
     2
     3        WebAssembly: Module.exports, Module.imports, Module.customSections are wrong
     4        https://bugs.webkit.org/show_bug.cgi?id=171078
     5
     6        Reviewed by Saam Barati.
     7
     8        They're static properties of Module, not instance properties of a module.
     9        https://github.com/WebAssembly/design/blob/master/JS.md#webassemblymoduleexports
     10
     11        * wasm/js/WebAssemblyModuleConstructor.cpp:
     12        (JSC::webAssemblyModuleCustomSections):
     13        (JSC::webAssemblyModuleImports):
     14        (JSC::webAssemblyModuleExports):
     15        * wasm/js/WebAssemblyModulePrototype.cpp:
     16        (JSC::webAssemblyModuleProtoCustomSections): Deleted.
     17        (JSC::webAssemblyModuleProtoImports): Deleted.
     18        (JSC::webAssemblyModuleProtoExports): Deleted.
     19
    1202017-04-21  Saam Barati  <sbarati@apple.com>
    221
  • trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModuleConstructor.cpp

    r215103 r215664  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2929#if ENABLE(WEBASSEMBLY)
    3030
     31#include "ArrayBuffer.h"
    3132#include "ExceptionHelpers.h"
    3233#include "FunctionPrototype.h"
     
    3738#include "JSWebAssemblyHelpers.h"
    3839#include "JSWebAssemblyModule.h"
     40#include "ObjectConstructor.h"
    3941#include "SymbolTable.h"
    4042#include "WasmCallee.h"
     43#include "WasmModuleInformation.h"
    4144#include "WasmPlan.h"
    4245#include "WebAssemblyModulePrototype.h"
    4346#include <wtf/StdLibExtras.h>
    4447
     48namespace JSC {
     49static EncodedJSValue JSC_HOST_CALL webAssemblyModuleCustomSections(ExecState*);
     50static EncodedJSValue JSC_HOST_CALL webAssemblyModuleImports(ExecState*);
     51static EncodedJSValue JSC_HOST_CALL webAssemblyModuleExports(ExecState*);
     52}
     53
    4554#include "WebAssemblyModuleConstructor.lut.h"
    4655
     
    5160/* Source for WebAssemblyModuleConstructor.lut.h
    5261 @begin constructorTableWebAssemblyModule
     62 customSections webAssemblyModuleCustomSections DontEnum|Function 2
     63 imports        webAssemblyModuleImports        DontEnum|Function 1
     64 exports        webAssemblyModuleExports        DontEnum|Function 1
    5365 @end
    5466 */
     67
     68EncodedJSValue JSC_HOST_CALL webAssemblyModuleCustomSections(ExecState* exec)
     69{
     70    VM& vm = exec->vm();
     71    auto* globalObject = exec->lexicalGlobalObject();
     72    auto throwScope = DECLARE_THROW_SCOPE(vm);
     73
     74    JSWebAssemblyModule* module = jsDynamicCast<JSWebAssemblyModule*>(vm, exec->argument(0));
     75    if (!module)
     76        return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("WebAssembly.Module.customSections called with non WebAssembly.Module argument"))));
     77
     78    const String sectionNameString = exec->argument(1).getString(exec);
     79    RETURN_IF_EXCEPTION(throwScope, { });
     80
     81    JSArray* result = constructEmptyArray(exec, nullptr, globalObject);
     82    RETURN_IF_EXCEPTION(throwScope, { });
     83
     84    const auto& customSections = module->moduleInformation().customSections;
     85    for (const Wasm::CustomSection& section : customSections) {
     86        if (String::fromUTF8(section.name) == sectionNameString) {
     87            auto buffer = ArrayBuffer::tryCreate(section.payload.data(), section.payload.size());
     88            if (!buffer)
     89                return JSValue::encode(throwException(exec, throwScope, createOutOfMemoryError(exec)));
     90
     91            result->push(exec, JSArrayBuffer::create(vm, globalObject->m_arrayBufferStructure.get(), WTFMove(buffer)));
     92            RETURN_IF_EXCEPTION(throwScope, { });
     93        }
     94    }
     95
     96    return JSValue::encode(result);
     97}
     98
     99EncodedJSValue JSC_HOST_CALL webAssemblyModuleImports(ExecState* exec)
     100{
     101    VM& vm = exec->vm();
     102    auto* globalObject = exec->lexicalGlobalObject();
     103    auto throwScope = DECLARE_THROW_SCOPE(vm);
     104
     105    JSWebAssemblyModule* module = jsDynamicCast<JSWebAssemblyModule*>(vm, exec->argument(0));
     106    if (!module)
     107        return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("WebAssembly.Module.imports called with non WebAssembly.Module argument"))));
     108
     109    JSArray* result = constructEmptyArray(exec, nullptr, globalObject);
     110    RETURN_IF_EXCEPTION(throwScope, { });
     111
     112    const auto& imports = module->moduleInformation().imports;
     113    if (imports.size()) {
     114        Identifier module = Identifier::fromString(exec, "module");
     115        Identifier name = Identifier::fromString(exec, "name");
     116        Identifier kind = Identifier::fromString(exec, "kind");
     117        for (const Wasm::Import& imp : imports) {
     118            JSObject* obj = constructEmptyObject(exec);
     119            RETURN_IF_EXCEPTION(throwScope, { });
     120            obj->putDirect(vm, module, jsString(exec, String::fromUTF8(imp.module)));
     121            obj->putDirect(vm, name, jsString(exec, String::fromUTF8(imp.field)));
     122            obj->putDirect(vm, kind, jsString(exec, String(makeString(imp.kind))));
     123            result->push(exec, obj);
     124            RETURN_IF_EXCEPTION(throwScope, { });
     125        }
     126    }
     127
     128    return JSValue::encode(result);
     129}
     130
     131EncodedJSValue JSC_HOST_CALL webAssemblyModuleExports(ExecState* exec)
     132{
     133    VM& vm = exec->vm();
     134    auto* globalObject = exec->lexicalGlobalObject();
     135    auto throwScope = DECLARE_THROW_SCOPE(vm);
     136
     137    JSWebAssemblyModule* module = jsDynamicCast<JSWebAssemblyModule*>(vm, exec->argument(0));
     138    if (!module)
     139        return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("WebAssembly.Module.exports called with non WebAssembly.Module argument"))));
     140
     141    JSArray* result = constructEmptyArray(exec, nullptr, globalObject);
     142    RETURN_IF_EXCEPTION(throwScope, { });
     143
     144    const auto& exports = module->moduleInformation().exports;
     145    if (exports.size()) {
     146        Identifier name = Identifier::fromString(exec, "name");
     147        Identifier kind = Identifier::fromString(exec, "kind");
     148        for (const Wasm::Export& exp : exports) {
     149            JSObject* obj = constructEmptyObject(exec);
     150            RETURN_IF_EXCEPTION(throwScope, { });
     151            obj->putDirect(vm, name, jsString(exec, String::fromUTF8(exp.field)));
     152            obj->putDirect(vm, kind, jsString(exec, String(makeString(exp.kind))));
     153            result->push(exec, obj);
     154            RETURN_IF_EXCEPTION(throwScope, { });
     155        }
     156    }
     157
     158    return JSValue::encode(result);
     159}
    55160
    56161static EncodedJSValue JSC_HOST_CALL constructJSWebAssemblyModule(ExecState* exec)
  • trunk/Source/JavaScriptCore/wasm/js/WebAssemblyModulePrototype.cpp

    r215353 r215664  
    2929#if ENABLE(WEBASSEMBLY)
    3030
    31 #include "ArrayBuffer.h"
    32 #include "FunctionPrototype.h"
    33 #include "JSArrayBuffer.h"
    3431#include "JSCInlines.h"
    35 #include "JSWebAssemblyModule.h"
    36 #include "ObjectConstructor.h"
    37 #include "WasmModuleInformation.h"
    38 
    39 namespace JSC {
    40 static EncodedJSValue JSC_HOST_CALL webAssemblyModuleProtoCustomSections(ExecState*);
    41 static EncodedJSValue JSC_HOST_CALL webAssemblyModuleProtoImports(ExecState*);
    42 static EncodedJSValue JSC_HOST_CALL webAssemblyModuleProtoExports(ExecState*);
    43 }
    4432
    4533#include "WebAssemblyModulePrototype.lut.h"
     
    5139/* Source for WebAssemblyModulePrototype.lut.h
    5240 @begin prototypeTableWebAssemblyModule
    53  customSections webAssemblyModuleProtoCustomSections DontEnum|Function 1
    54  imports        webAssemblyModuleProtoImports        DontEnum|Accessor 0
    55  exports        webAssemblyModuleProtoExports        DontEnum|Accessor 0
    5641 @end
    5742 */
    58 
    59 EncodedJSValue JSC_HOST_CALL webAssemblyModuleProtoCustomSections(ExecState* exec)
    60 {
    61     VM& vm = exec->vm();
    62     auto* globalObject = exec->lexicalGlobalObject();
    63     auto throwScope = DECLARE_THROW_SCOPE(vm);
    64 
    65     JSWebAssemblyModule* module = jsDynamicCast<JSWebAssemblyModule*>(vm, exec->thisValue());
    66     if (!module)
    67         return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("WebAssembly.Module.prototype.customSections called with non WebAssembly.Module |this| value"))));
    68 
    69     const String sectionNameString = exec->argument(0).getString(exec);
    70     RETURN_IF_EXCEPTION(throwScope, { });
    71 
    72     JSArray* result = constructEmptyArray(exec, nullptr, globalObject);
    73     RETURN_IF_EXCEPTION(throwScope, { });
    74 
    75     const auto& customSections = module->moduleInformation().customSections;
    76     for (const Wasm::CustomSection& section : customSections) {
    77         if (String::fromUTF8(section.name) == sectionNameString) {
    78             auto buffer = ArrayBuffer::tryCreate(section.payload.data(), section.payload.size());
    79             if (!buffer)
    80                 return JSValue::encode(throwException(exec, throwScope, createOutOfMemoryError(exec)));
    81 
    82             Structure* arrayBufferStructure = InternalFunction::createSubclassStructure(exec, JSValue(), globalObject->arrayBufferStructure(ArrayBufferSharingMode::Default));
    83             RETURN_IF_EXCEPTION(throwScope, { });
    84 
    85             result->push(exec, JSArrayBuffer::create(vm, arrayBufferStructure, WTFMove(buffer)));
    86             RETURN_IF_EXCEPTION(throwScope, { });
    87         }
    88     }
    89 
    90     return JSValue::encode(result);
    91 }
    92 
    93 EncodedJSValue JSC_HOST_CALL webAssemblyModuleProtoImports(ExecState* exec)
    94 {
    95     VM& vm = exec->vm();
    96     auto* globalObject = exec->lexicalGlobalObject();
    97     auto throwScope = DECLARE_THROW_SCOPE(vm);
    98 
    99     JSWebAssemblyModule* module = jsDynamicCast<JSWebAssemblyModule*>(vm, exec->thisValue());
    100     if (!module)
    101         return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("WebAssembly.Module.prototype.imports called with non WebAssembly.Module |this| value"))));
    102 
    103     JSArray* result = constructEmptyArray(exec, nullptr, globalObject);
    104     RETURN_IF_EXCEPTION(throwScope, { });
    105 
    106     const auto& imports = module->moduleInformation().imports;
    107     if (imports.size()) {
    108         Identifier module = Identifier::fromString(exec, "module");
    109         Identifier name = Identifier::fromString(exec, "name");
    110         Identifier kind = Identifier::fromString(exec, "kind");
    111         for (const Wasm::Import& imp : imports) {
    112             JSObject* obj = constructEmptyObject(exec);
    113             RETURN_IF_EXCEPTION(throwScope, { });
    114             obj->putDirect(vm, module, jsString(exec, String::fromUTF8(imp.module)));
    115             obj->putDirect(vm, name, jsString(exec, String::fromUTF8(imp.field)));
    116             obj->putDirect(vm, kind, jsString(exec, String(makeString(imp.kind))));
    117             result->push(exec, obj);
    118             RETURN_IF_EXCEPTION(throwScope, { });
    119         }
    120     }
    121 
    122     return JSValue::encode(result);
    123 }
    124 
    125 EncodedJSValue JSC_HOST_CALL webAssemblyModuleProtoExports(ExecState* exec)
    126 {
    127     VM& vm = exec->vm();
    128     auto* globalObject = exec->lexicalGlobalObject();
    129     auto throwScope = DECLARE_THROW_SCOPE(vm);
    130 
    131     JSWebAssemblyModule* module = jsDynamicCast<JSWebAssemblyModule*>(vm, exec->thisValue());
    132     if (!module)
    133         return JSValue::encode(throwException(exec, throwScope, createTypeError(exec, ASCIILiteral("WebAssembly.Module.prototype.exports called with non WebAssembly.Module |this| value"))));
    134 
    135     JSArray* result = constructEmptyArray(exec, nullptr, globalObject);
    136     RETURN_IF_EXCEPTION(throwScope, { });
    137 
    138     const auto& exports = module->moduleInformation().exports;
    139     if (exports.size()) {
    140         Identifier name = Identifier::fromString(exec, "name");
    141         Identifier kind = Identifier::fromString(exec, "kind");
    142         for (const Wasm::Export& exp : exports) {
    143             JSObject* obj = constructEmptyObject(exec);
    144             RETURN_IF_EXCEPTION(throwScope, { });
    145             obj->putDirect(vm, name, jsString(exec, String::fromUTF8(exp.field)));
    146             obj->putDirect(vm, kind, jsString(exec, String(makeString(exp.kind))));
    147             result->push(exec, obj);
    148             RETURN_IF_EXCEPTION(throwScope, { });
    149         }
    150     }
    151 
    152     return JSValue::encode(result);
    153 }
    15443
    15544WebAssemblyModulePrototype* WebAssemblyModulePrototype::create(VM& vm, JSGlobalObject*, Structure* structure)
Note: See TracChangeset for help on using the changeset viewer.