Comments (4)
I would assume that it indeed outputs with the square brackets and quotes.
In my Safari, it outputs function $+() {
as the first line; in Chrome, it outputs function get $+() {
; in FF, it matches Safari.
The spec allows a lot of things that are unwise; I would hope that since the browsers don't agree, that it would be feasible (altho surely low priority) for them all to change to the reasonable thing?
from test262.
FWIW: This issue is also filed at https://bugzilla.mozilla.org/show_bug.cgi?id=1658492.
from test262.
However, how should we handle the result of
Function.prototype.toString
for built-in functions with invalid names as identifiers (e.g.,RegExp["$+"]
that is not standardized yet)?
It is not standardized yet, but it is part of https://github.com/tc39/proposal-regexp-legacy-features which is a stage 3 proposal. Therefore it's fair game to have tests in test262 for it.
By my reading, the unambiguously correct output according to the spec is function get $+() { [native code] }
so I'd say that's what we should test for, but...
I'd suggest opening an issue in that proposal. In ECMA-262 as far as I know, there are no builtin functions that have a name that is a String but isn't a LiteralPropertyName, so step 4 of SetFunctionName has no need to emit a ComputedPropertyName when name is a String. With the introduction of Legacy RegExp Features, that assumption becomes incorrect (note that it might not be an intended assumption, though.) This seems like it's worth bringing a normative change to committee.
from test262.
Actually, I see there already is such an issue: tc39/proposal-regexp-legacy-features#19
from test262.
Related Issues (20)
- $262.IsHTMLDDA's [[Call]] behavior is underspecified
- The Decorators proposal does not have enough tests HOT 2
- Tests using `__proto__` without appropriate `features` entry HOT 1
- Guidance on writing testing plans and where to include them in the process HOT 1
- Tests for `-->` in the first line should not have `raw` flag. HOT 2
- test/harness/testTypedArray{,-conversions}.js not updated for Float16Array
- Ideas for additional coverage for base64
- Add test case for `Object.groupBy` / `Map.groupBy` with strings? HOT 3
- Decorators Testing Plan
- Mapping between Test262 and web-features HOT 10
- Remove non-existend "AsyncArrowFunction" constructor
- Please sync the test to intl-duration-format/pull PR181 HOT 1
- Math.sumPrecise testing plan HOT 3
- nanoseconds: Number.MAX_VALUE in precision-exact-mathematical-values HOT 4
- Question: NPM Registry HOT 4
- `new Iterator()` should throw `TypeError`? HOT 2
- Add more tests for `v` flag
- Various ECMA links 404
- Testing plan for JSON-parse-with-source HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from test262.