Closed Bug 1574180 Opened 6 years ago Closed 6 years ago

Set "name" property for all anonymous functions

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(7 files)

Implement the spec changes from https://github.com/tc39/ecma262/pull/1490.

Priority: -- → P1

This ensures an empty string is used for the name and actually also matches
the spec since https://github.com/tc39/ecma402/pull/208.

Default the "name" property of anonymous class expressions to the empty string
by removing the special case in JSFunction::infallibleGetUnresolvedName().
With that change applied, infallibleGetUnresolvedName() never returns nullptr,
so we can remove nullptr handling in its callers. And additionally
JSFunction::getUnresolvedName() can be changed back to use MutableHandleValue
as its parameter, which also (re-)aligns the function with getUnresolvedLength().

Depends on D42153

An absent name and an empty string as the inferred name are now
indistinguishable, so we can remove the special case for empty strings in
ObjectEmitter.

Depends on D42154

Update test262 to get the changes from https://github.com/tc39/test262/pull/2299.

Pushed by nbeleuzu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5bc09a0dde11
Part 7: Update test262 exclusions. r=khyperia

Keywords: checkin-needed
Pushed by nbeleuzu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/782ab98dcdc6 Part 1: Use function closures instead of bound functions for cached getter functions. r=jorendorff https://hg.mozilla.org/integration/autoland/rev/721c8caa85e3 Part 2: Assign "name" property for anonymous class expressions. r=khyperia https://hg.mozilla.org/integration/autoland/rev/9d1a72c0bb0c Part 3: Remove special-case for inferred empty name string. r=khyperia https://hg.mozilla.org/integration/autoland/rev/e2a74d92bdab Part 4: Update comment for "name" property of TypeErrorThrower. r=khyperia https://hg.mozilla.org/integration/autoland/rev/69a6c6867bde Part 5: Update test262 features list. r=khyperia
Backout by nbeleuzu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/819718b9de10 Backed out 7 changesets for jsreftest failures on resolve-element-function-name.js . CLOSED TREE
Pushed by nbeleuzu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/17c3ae6d4a96 Part 1: Use function closures instead of bound functions for cached getter functions. r=jorendorff https://hg.mozilla.org/integration/autoland/rev/e6d2c7668965 Part 2: Assign "name" property for anonymous class expressions. r=khyperia https://hg.mozilla.org/integration/autoland/rev/e0ffbccc9edc Part 3: Remove special-case for inferred empty name string. r=khyperia https://hg.mozilla.org/integration/autoland/rev/4d341c6816c2 Part 4: Update comment for "name" property of TypeErrorThrower. r=khyperia https://hg.mozilla.org/integration/autoland/rev/f53ba6ebc0b7 Part 5: Update test262 features list. r=khyperia https://hg.mozilla.org/integration/autoland/rev/bc2a756c4554 Part 6: Update test262. r=khyperia https://hg.mozilla.org/integration/autoland/rev/f5da79194d06 Part 7: Update test262 exclusions. r=khyperia
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: