-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Symbol.species to ArrayConstructor, MapConstructor, SetConstructo… #18652
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,7 +150,7 @@ interface Promise<T> { | |
} | ||
|
||
interface PromiseConstructor { | ||
readonly [Symbol.species]: Function; | ||
readonly [Symbol.species]: PromiseConstructor; | ||
} | ||
|
||
interface RegExp { | ||
|
@@ -202,7 +202,7 @@ interface RegExp { | |
} | ||
|
||
interface RegExpConstructor { | ||
[Symbol.species](): RegExpConstructor; | ||
readonly [Symbol.species]: RegExpConstructor; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per the spec, the property type should be |
||
} | ||
|
||
interface String { | ||
|
@@ -283,3 +283,16 @@ interface Float32Array { | |
interface Float64Array { | ||
readonly [Symbol.toStringTag]: "Float64Array"; | ||
} | ||
|
||
interface ArrayConstructor { | ||
readonly [Symbol.species]: ArrayConstructor; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per the spec, the property type should be |
||
} | ||
interface MapConstructor { | ||
readonly [Symbol.species]: MapConstructor; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per the spec, the property type should be |
||
} | ||
interface SetConstructor { | ||
readonly [Symbol.species]: SetConstructor; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per the spec, the property type should be |
||
} | ||
interface ArrayBufferConstructor { | ||
readonly [Symbol.species]: ArrayBufferConstructor; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per the spec, the property type should be |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the spec, the property type should be
this
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DanielRosenwasser, do you know if using a
this
type here would be problematic for someone writing a subclass?