[JSC] Anonymous built-in functions should have empty string for a name
Created attachment 383590 [details] Patch
Note: These fixes are associated with https://github.com/tc39/ecma262/pull/1490.
Comment on attachment 383590 [details] Patch Attachment 383590 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/13257634 New failing tests: imported/blink/fast/events/panScroll-crash.html
Created attachment 383601 [details] Archive of layout-test-results from ews213 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews213 Port: win-future Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
Created attachment 383643 [details] Patch
Created attachment 383648 [details] Patch
Created attachment 383649 [details] Patch
Created attachment 383663 [details] Patch
Comment on attachment 383663 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=383663&action=review r=me with nits. > Source/JavaScriptCore/builtins/PromiseConstructor.js:244 > - function @resolve(resolution) { > + function (resolution) { > return @resolvePromiseWithFirstResolvingFunctionCallCheck(capturedPromise, resolution); > }, > - function @reject(reason) { > + function (reason) { > return @rejectPromiseWithFirstResolvingFunctionCallCheck(capturedPromise, reason); You need to change InternalPromise constructor's one too. > Source/JavaScriptCore/runtime/ProxyRevoke.cpp:54 > + Base::finishCreation(vm, ""_s); Pass `emptyString()`.
Created attachment 383678 [details] Patch for landing
Comment on attachment 383678 [details] Patch for landing Clearing flags on attachment: 383678 Committed r252520: <https://trac.webkit.org/changeset/252520>
All reviewed patches have been landed. Closing bug.
<rdar://problem/57248654>
Comment on attachment 383678 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=383678&action=review > Source/JavaScriptCore/runtime/FunctionRareData.h:129 > + FunctionRareData(VM&); In a case like this it’s good to add "explicit" since this is now a single-argument constructor and "explicit" has value to make sure those aren’t accidentally used for type conversion. On the other hand, with modern C++ we could be using explicit a lot more on most constructors that aren’t intended to be used for type conversion, even ones that don’t have a single argument, and that would affect a lot of code and not sure everyone agrees this would be good.
Comment on attachment 383678 [details] Patch for landing View in context: https://bugs.webkit.org/attachment.cgi?id=383678&action=review > Source/JavaScriptCore/runtime/JSFunctionInlines.h:109 > + return m_rareData ? m_rareData->hasReifiedName() : false; I personally like the && syntax for cases like this better than ? : like this and find that it is easy to understand and reason about: return m_rareData && m_rareData->hasReifiedName();
(In reply to Darin Adler from comment #14) > Comment on attachment 383678 [details] > Patch for landing > > View in context: > https://bugs.webkit.org/attachment.cgi?id=383678&action=review > > > Source/JavaScriptCore/runtime/FunctionRareData.h:129 > > + FunctionRareData(VM&); > > In a case like this it’s good to add "explicit" since this is now a > single-argument constructor and "explicit" has value to make sure those > aren’t accidentally used for type conversion. Good point! Will address. (In reply to Darin Adler from comment #15) > Comment on attachment 383678 [details] > Patch for landing > > View in context: > https://bugs.webkit.org/attachment.cgi?id=383678&action=review > > > Source/JavaScriptCore/runtime/JSFunctionInlines.h:109 > > + return m_rareData ? m_rareData->hasReifiedName() : false; > > I personally like the && syntax for cases like this better than ? : like > this and find that it is easy to understand and reason about: > > return m_rareData && m_rareData->hasReifiedName(); I guess I was thinking in JavaScript mode where this wouldn't return the right type, but I guess the coercion works to one's advantage in C++, doesn't it. :P
Committed r252547: <https://trac.webkit.org/changeset/252547>
(In reply to Ross Kirsling from comment #16) > (In reply to Darin Adler from comment #14) > > I personally like the && syntax for cases like this better than ? : like > > this and find that it is easy to understand and reason about: > > > > return m_rareData && m_rareData->hasReifiedName(); > > I guess I was thinking in JavaScript mode where this wouldn't return the > right type, but I guess the coercion works to one's advantage in C++, > doesn't it. :P If the "coercion" wasn't present in C++ I would probably write: return m_rareData != nullptr && m_rareData->hasReifiedName();