RESOLVED FIXED 217115
[JSC] Implement item method proposal
https://bugs.webkit.org/show_bug.cgi?id=217115
Summary [JSC] Implement item method proposal
Ross Kirsling
Reported 2020-09-29 18:33:45 PDT
[JSC] Implement item method proposal
Attachments
Patch (11.50 KB, patch)
2020-09-29 18:44 PDT, Ross Kirsling
no flags
Patch (19.61 KB, patch)
2020-09-29 19:22 PDT, Ross Kirsling
no flags
Patch for landing (19.74 KB, patch)
2020-09-30 12:09 PDT, Ross Kirsling
no flags
Patch for landing (19.70 KB, patch)
2020-09-30 16:53 PDT, Ross Kirsling
no flags
Ross Kirsling
Comment 1 2020-09-29 18:44:32 PDT
Ross Kirsling
Comment 2 2020-09-29 19:22:45 PDT
Yusuke Suzuki
Comment 3 2020-09-30 10:59:49 PDT
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.
Ross Kirsling
Comment 4 2020-09-30 12:09:09 PDT
Created attachment 410144 [details] Patch for landing
EWS
Comment 5 2020-09-30 14:32:00 PDT
Found 1 new test failure: inspector/console/queryHolders.html
Ross Kirsling
Comment 6 2020-09-30 16:53:38 PDT Comment hidden (obsolete)
EWS
Comment 7 2020-09-30 17:40:11 PDT
Committed r267814: <https://trac.webkit.org/changeset/267814> All reviewed patches have been landed. Closing bug and clearing flags on attachment 410144 [details].
Radar WebKit Bug Importer
Comment 8 2020-09-30 17:41:19 PDT
Note You need to log in before you can comment on or make changes to this bug.