[Webkit-unassigned] [Bug 160410] [ES2016] Implement Object.values
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Aug 2 15:46:30 PDT 2016
https://bugs.webkit.org/show_bug.cgi?id=160410
Saam Barati <sbarati at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #285142|review? |review-
Flags| |
--- Comment #9 from Saam Barati <sbarati at apple.com> ---
Comment on attachment 285142
--> https://bugs.webkit.org/attachment.cgi?id=285142
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=285142&action=review
> Source/JavaScriptCore/runtime/ObjectConstructor.cpp:781
> +// http://tc39.github.io/proposal-object-values-entries/
Lets provide links to the spec instead of proposals.
> Source/JavaScriptCore/runtime/ObjectConstructor.cpp:783
> +JSArray* ownEnumerableProperties(ExecState* exec, JSObject* object, ResultKind resultKind, DontEnumPropertiesMode dontEnumPropertiesMode)
I'd really like to see this written in JavaScript as a builtin instead.
It'd probably require making certain Reflect APIs and maybe Reflect itself available as a private symbol.
I think that would remove a certain class of bugs and might even be faster if it gets inlined into the caller.
> Source/JavaScriptCore/runtime/ObjectConstructor.cpp:802
> + keys->push(exec, jsOwnedString(exec, identifier.string()));
can push() throw an exception?
> Source/JavaScriptCore/runtime/ObjectConstructor.cpp:813
> + JSValue result = baseValue.get(exec, identifier, slot);
This needs an exception check afterwards if you keep it in C++ code
> Source/JavaScriptCore/runtime/ObjectConstructor.h:36
> +EncodedJSValue JSC_HOST_CALL ownEnumerablePropertyValues(ExecState*);
Not used.
> Source/JavaScriptCore/runtime/ObjectConstructor.h:43
> +enum class ResultKind {
> + Key = 1 << 0,
> + Value = 1 << 1,
> + KeyAndValue = Key | Value,
> +};
Don't we already have an enum that represents this?
> JSTests/stress/object-values.js:1
> +var obj = Object.create({ a: "qux", d: "qux" });
Lets add some Proxy tests and ensure proper methods are called.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160802/c0d3041c/attachment-0001.html>
More information about the webkit-unassigned
mailing list