Summary: | [[Set]] should be properly executed in JS builtins | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yusuke Suzuki <ysuzuki> | ||||||
Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, fpizlo, ggaren, sam | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Bug Depends on: | 143926 | ||||||||
Bug Blocks: | |||||||||
Attachments: |
|
Description
Yusuke Suzuki
2015-04-21 09:44:16 PDT
I prefer option (1) because it is more obvious. Bracket access in a builtin has the same meaning as bracket access in normal JavaScript, and if you need non-traditional behavior, you must specify that. So far, every time I've encountered something in builtins that did not match regular JavaScript -- for example, conversion of put_by_val to put_by_val_direct, conversion of undefined to @undefined, not quite parsing the .js file as a normal program, ASSERTing that no capturing has taken place -- I have been surprised, and lost half a day to debugging. I'd like to remove these surprises over time. I think it is also nice for our builtins to annotate which features they require that are not possible in the programming language. Over time, we should urge the standards committee to make these features a part of the language. (In reply to comment #1) > I prefer option (1) because it is more obvious. Bracket access in a builtin > has the same meaning as bracket access in normal JavaScript, and if you need > non-traditional behavior, you must specify that. > > So far, every time I've encountered something in builtins that did not match > regular JavaScript -- for example, conversion of put_by_val to > put_by_val_direct, conversion of undefined to @undefined, not quite parsing > the .js file as a normal program, ASSERTing that no capturing has taken > place -- I have been surprised, and lost half a day to debugging. I'd like > to remove these surprises over time. > > I think it is also nice for our builtins to annotate which features they > require that are not possible in the programming language. Over time, we > should urge the standards committee to make these features a part of the > language. Agreed. I think (1) is preferable too because it is intuitive that the witten JS code in builtins works as the same to the usual JS code. Created attachment 251314 [details]
Patch
Created attachment 251315 [details]
Patch
Comment on attachment 251315 [details]
Patch
r=me
Comment on attachment 251315 [details]
Patch
Thank you for your review!
Comment on attachment 251315 [details] Patch Clearing flags on attachment: 251315 Committed r183117: <http://trac.webkit.org/changeset/183117> All reviewed patches have been landed. Closing bug. |