Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add support for Symbol objects via JSSymbol #183

Merged
merged 6 commits into from
Apr 10, 2022

Conversation

j-f1
Copy link
Member

@j-f1 j-f1 commented Apr 8, 2022

This re-adds the functionality removed by #180.

(I accidentally pushed this change to main first, sorry about that!)

The Reflect namespace is mainly intended for use with Proxy objects, with each function on that namespace matching the signature of the corresponding proxy trap. For most use cases, normal access is preferable.

The test failure was occurring because Reflect.* functions check that their parameter is really an object. While this is the case for objects, symbols aren’t objects; the [] syntax automatically converts to an object where necessary.

@github-actions
Copy link

github-actions bot commented Apr 8, 2022

Time Change: +603.75ms (7%) 🔍

Total Time: 8,585.75ms

Test name Duration Change
Serialization/Write JavaScript number directly 203.5ms +34.25ms (16%) ⚠️
Serialization/Write JavaScript string directly 197ms +22.25ms (11%) ⚠️
Serialization/Swift Int to JavaScript 2,670ms +250.25ms (9%) 🔍
Serialization/Swift String to JavaScript 2,666.25ms +207.25ms (7%) 🔍
ℹ️ View Unchanged
Test name Duration Change
Object heap/Increment and decrement RC 2,849ms +89.75ms (3%)

performance-action

@j-f1 j-f1 marked this pull request as ready for review April 8, 2022 21:44
@j-f1 j-f1 requested a review from a team April 8, 2022 21:48
Copy link
Contributor

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@kateinoigakukun
Copy link
Member

For the record: https://tc39.es/ecma262/#sec-reflect.get

28.1.5 Reflect.get ( target, propertyKey [ , receiver ] )
When the get function is called with arguments target, propertyKey, and receiver, the following steps are taken:

  1. If Type(target) is not Object, throw a TypeError exception.

Copy link
Member

@kateinoigakukun kateinoigakukun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)

@kateinoigakukun kateinoigakukun merged commit 8c20a89 into main Apr 10, 2022
@kateinoigakukun kateinoigakukun deleted the jed/re-add-symbol branch April 10, 2022 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants