[Webkit-unassigned] [Bug 220323] [WASM-References] Add optional default value parameter for Table.grow

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 5 12:35:04 PST 2021


https://bugs.webkit.org/show_bug.cgi?id=220323

Yusuke Suzuki <ysuzuki at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ysuzuki at apple.com
 Attachment #416994|review?                     |review-
              Flags|                            |

--- Comment #2 from Yusuke Suzuki <ysuzuki at apple.com> ---
Comment on attachment 416994
  --> https://bugs.webkit.org/attachment.cgi?id=416994
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=416994&action=review

r- since I found a bug. We also need description more about the change.

> Source/JavaScriptCore/ChangeLog:8
> +        Introduce the Table.grow optional default value.

ChangeLog is super important in WebKit project.
Please add more comments about changes in ChangeLog.
We need more description about the change in particular, for feature change.

> Source/JavaScriptCore/wasm/js/WebAssemblyTablePrototype.cpp:100
> +    JSValue defaultValue = callFrame->argument(1);
> +    if (defaultValue.isUndefined())
> +        defaultValue = jsNull();
>      uint32_t oldLength = table->length();
>  
> -    if (!table->grow(delta))
> +    if (!table->grow(delta, defaultValue))
>          return JSValue::encode(throwException(globalObject, throwScope, createRangeError(globalObject, "WebAssembly.Table.prototype.grow could not grow the table"_s)));

I think this has a bug.
If table is function ref table, then values that can be configured to the table is limited.
Can you align the implementation to the spec's change? https://webassembly.github.io/reference-types/js-api/index.html#dom-table-grow

5. If value is missing,
5.1. Let ref be DefaultValue(elementType).
6. Otherwise,
6.1. Let ref be ? ToWebAssemblyValue(value, elementType).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210105/63634d65/attachment.htm>


More information about the webkit-unassigned mailing list