[Webkit-unassigned] [Bug 186694] [ESNExt] String.prototype.matchAll

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 13 18:12:14 PDT 2019


--- Comment #29 from Alexey Shvayka <shvaikalesh at gmail.com> ---
(In reply to Yusuke Suzuki from comment #27)
> Comment on attachment 372055 [details]
> Patch
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=372055&action=review
> The logic looks nice.
> > Source/JavaScriptCore/CMakeLists.txt:934
> > +    runtime/RegExpStringIteratorPrototype.h
> Let’s add these files (added h, cpp, and generated code from js file etc.
> maybe js file too.) to Xcode project file too?
> At that time, be careful that Xcode should not build the added cpp files
> directly. We are using unified builds.
> So we need to set “target” configuration in Xcode property.
> See the similar files and align these files to them.

Thank you for detailed tips, I've fixed the build via Xcode UI.

> > Source/JavaScriptCore/builtins/RegExpPrototype.js:28
> > +function RegExpStringIteratorConstructor(R, S, global, fullUnicode)
> Rename this to createRegExpStringIterator.

Using `new` with `create*` function looks kinda weird.
Idiomatic JS is `new` with title-cased constructor, just like we already have with AsyncFromSyncIterator:

return new @AsyncFromSyncIteratorConstructor(syncIterator, nextMethod);

AsyncFromSyncIterator does indeed expose `createAsyncFromSyncIterator` helper for BytecodeGenerator,
but I not sure it is something we need for RegExpStringIterator.


On performance: we can't use any of already defined fast RegExp methods.
We can avoid extra sets and property lookups in two places:
1. After @speciesConstructor in RegExp.prototype[@@matchAll]
2. After last @getByIdDirectPrivate in %RegExpStringIteratorPrototype%.next.

Given that we will have to call @hasObservableSideEffects in `next` every time, does it worth it?

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190614/d247d428/attachment.html>

More information about the webkit-unassigned mailing list