Summary: | [JSC] Implement item method proposal | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Ross Kirsling <ross.kirsling> | ||||||||||
Component: | New Bugs | Assignee: | Ross Kirsling <ross.kirsling> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | ews-watchlist, hi, joepeck, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer, ysuzuki | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | WebKit Nightly Build | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | Unspecified | ||||||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=217193 | ||||||||||||
Bug Depends on: | |||||||||||||
Bug Blocks: | 217139 | ||||||||||||
Attachments: |
|
Description
Ross Kirsling
2020-09-29 18:33:45 PDT
Created attachment 410083 [details]
Patch
Created attachment 410087 [details]
Patch
Comment on attachment 410087 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=410087&action=review > Source/JavaScriptCore/builtins/StringPrototype.js:358 > +function item(index) > +{ > + "use strict"; > + > + if (@isUndefinedOrNull(this)) > + @throwTypeError("String.prototype.item requires that |this| not be null or undefined"); > + > + var string = @toString(this); > + var length = string.length; > + > + var k = @toInteger(index); > + if (k < 0) > + k += length; > + > + return (k >= 0 && k < length) ? string[k] : @undefined; > +} Can you file a bug making String#item accelerated like String#charAt? And can you add FIXME to that bug here? I think item and charAt are super similar. Created attachment 410144 [details]
Patch for landing
Found 1 new test failure: inspector/console/queryHolders.html Created attachment 410172 [details]
Patch for landing
Committed r267814: <https://trac.webkit.org/changeset/267814> All reviewed patches have been landed. Closing bug and clearing flags on attachment 410144 [details]. |