2015-01-21 00:34:57 +00:00
|
|
|
|
|
|
|
-----------------------------------------------------
|
|
|
|
EXPRESSION: window.simpleObject
|
|
|
|
type: object
|
|
|
|
description: Object
|
|
|
|
|
|
|
|
OWN PROPERTIES:
|
|
|
|
a
|
|
|
|
b
|
|
|
|
__proto__
|
|
|
|
|
2015-02-25 00:31:42 +00:00
|
|
|
DISPLAYABLE PROPERTIES:
|
2015-01-21 00:34:57 +00:00
|
|
|
a
|
|
|
|
b
|
|
|
|
__proto__
|
|
|
|
|
|
|
|
ALL PROPERTIES:
|
|
|
|
a
|
|
|
|
b
|
|
|
|
toString
|
|
|
|
toLocaleString
|
|
|
|
valueOf
|
|
|
|
hasOwnProperty
|
|
|
|
propertyIsEnumerable
|
|
|
|
isPrototypeOf
|
|
|
|
__defineGetter__
|
|
|
|
__defineSetter__
|
|
|
|
__lookupGetter__
|
|
|
|
__lookupSetter__
|
|
|
|
constructor
|
|
|
|
__proto__
|
|
|
|
-----------------------------------------------------
|
|
|
|
|
2016-08-30 02:07:12 +00:00
|
|
|
-----------------------------------------------------
|
|
|
|
EXPRESSION: window.simpleArray
|
|
|
|
type: object
|
|
|
|
subtype: array
|
|
|
|
description: Array
|
|
|
|
|
|
|
|
OWN PROPERTIES:
|
|
|
|
0
|
|
|
|
1
|
|
|
|
2
|
|
|
|
__proto__
|
|
|
|
|
|
|
|
DISPLAYABLE PROPERTIES:
|
|
|
|
0
|
|
|
|
1
|
|
|
|
2
|
|
|
|
__proto__
|
|
|
|
|
|
|
|
ALL PROPERTIES:
|
|
|
|
0
|
|
|
|
1
|
|
|
|
2
|
|
|
|
length
|
|
|
|
toString
|
|
|
|
values
|
|
|
|
toLocaleString
|
|
|
|
concat
|
|
|
|
fill
|
|
|
|
join
|
|
|
|
pop
|
|
|
|
push
|
|
|
|
reverse
|
|
|
|
shift
|
|
|
|
slice
|
|
|
|
sort
|
|
|
|
splice
|
|
|
|
unshift
|
|
|
|
every
|
|
|
|
forEach
|
|
|
|
some
|
|
|
|
indexOf
|
|
|
|
lastIndexOf
|
|
|
|
filter
|
2018-05-26 18:17:09 +00:00
|
|
|
flat
|
2018-02-08 10:43:13 +00:00
|
|
|
flatMap
|
2016-08-30 02:07:12 +00:00
|
|
|
reduce
|
|
|
|
reduceRight
|
|
|
|
map
|
|
|
|
keys
|
2020-01-09 06:07:29 +00:00
|
|
|
entries
|
2016-08-30 02:07:12 +00:00
|
|
|
find
|
2021-08-21 12:10:09 +00:00
|
|
|
findLast
|
2016-08-30 02:07:12 +00:00
|
|
|
findIndex
|
2021-08-21 12:10:09 +00:00
|
|
|
findLastIndex
|
2016-08-30 02:07:12 +00:00
|
|
|
includes
|
|
|
|
copyWithin
|
2020-12-08 20:15:14 +00:00
|
|
|
at
|
2016-08-30 02:07:12 +00:00
|
|
|
constructor
|
|
|
|
Symbol(Symbol.iterator)
|
|
|
|
Symbol(Symbol.unscopables)
|
|
|
|
valueOf
|
|
|
|
hasOwnProperty
|
|
|
|
propertyIsEnumerable
|
|
|
|
isPrototypeOf
|
|
|
|
__defineGetter__
|
|
|
|
__defineSetter__
|
|
|
|
__lookupGetter__
|
|
|
|
__lookupSetter__
|
|
|
|
__proto__
|
|
|
|
-----------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------
|
|
|
|
EXPRESSION: window.arrayProto
|
|
|
|
type: object
|
|
|
|
subtype: array
|
|
|
|
description: Array
|
|
|
|
|
|
|
|
OWN PROPERTIES:
|
|
|
|
length
|
|
|
|
toString
|
|
|
|
values
|
|
|
|
toLocaleString
|
|
|
|
concat
|
|
|
|
fill
|
|
|
|
join
|
|
|
|
pop
|
|
|
|
push
|
|
|
|
reverse
|
|
|
|
shift
|
|
|
|
slice
|
|
|
|
sort
|
|
|
|
splice
|
|
|
|
unshift
|
|
|
|
every
|
|
|
|
forEach
|
|
|
|
some
|
|
|
|
indexOf
|
|
|
|
lastIndexOf
|
|
|
|
filter
|
2018-05-26 18:17:09 +00:00
|
|
|
flat
|
2018-02-08 10:43:13 +00:00
|
|
|
flatMap
|
2016-08-30 02:07:12 +00:00
|
|
|
reduce
|
|
|
|
reduceRight
|
|
|
|
map
|
|
|
|
keys
|
2020-01-09 06:07:29 +00:00
|
|
|
entries
|
2016-08-30 02:07:12 +00:00
|
|
|
find
|
2021-08-21 12:10:09 +00:00
|
|
|
findLast
|
2016-08-30 02:07:12 +00:00
|
|
|
findIndex
|
2021-08-21 12:10:09 +00:00
|
|
|
findLastIndex
|
2016-08-30 02:07:12 +00:00
|
|
|
includes
|
|
|
|
copyWithin
|
2020-12-08 20:15:14 +00:00
|
|
|
at
|
2016-08-30 02:07:12 +00:00
|
|
|
constructor
|
|
|
|
Symbol(Symbol.iterator)
|
|
|
|
Symbol(Symbol.unscopables)
|
|
|
|
__proto__
|
|
|
|
|
|
|
|
DISPLAYABLE PROPERTIES:
|
|
|
|
length
|
|
|
|
toString
|
|
|
|
values
|
|
|
|
toLocaleString
|
|
|
|
concat
|
|
|
|
fill
|
|
|
|
join
|
|
|
|
pop
|
|
|
|
push
|
|
|
|
reverse
|
|
|
|
shift
|
|
|
|
slice
|
|
|
|
sort
|
|
|
|
splice
|
|
|
|
unshift
|
|
|
|
every
|
|
|
|
forEach
|
|
|
|
some
|
|
|
|
indexOf
|
|
|
|
lastIndexOf
|
|
|
|
filter
|
2018-05-26 18:17:09 +00:00
|
|
|
flat
|
2018-02-08 10:43:13 +00:00
|
|
|
flatMap
|
2016-08-30 02:07:12 +00:00
|
|
|
reduce
|
|
|
|
reduceRight
|
|
|
|
map
|
|
|
|
keys
|
2020-01-09 06:07:29 +00:00
|
|
|
entries
|
2016-08-30 02:07:12 +00:00
|
|
|
find
|
2021-08-21 12:10:09 +00:00
|
|
|
findLast
|
2016-08-30 02:07:12 +00:00
|
|
|
findIndex
|
2021-08-21 12:10:09 +00:00
|
|
|
findLastIndex
|
2016-08-30 02:07:12 +00:00
|
|
|
includes
|
|
|
|
copyWithin
|
2020-12-08 20:15:14 +00:00
|
|
|
at
|
2016-08-30 02:07:12 +00:00
|
|
|
constructor
|
|
|
|
Symbol(Symbol.iterator)
|
|
|
|
Symbol(Symbol.unscopables)
|
|
|
|
__proto__
|
|
|
|
|
|
|
|
ALL PROPERTIES:
|
|
|
|
length
|
|
|
|
toString
|
|
|
|
values
|
|
|
|
toLocaleString
|
|
|
|
concat
|
|
|
|
fill
|
|
|
|
join
|
|
|
|
pop
|
|
|
|
push
|
|
|
|
reverse
|
|
|
|
shift
|
|
|
|
slice
|
|
|
|
sort
|
|
|
|
splice
|
|
|
|
unshift
|
|
|
|
every
|
|
|
|
forEach
|
|
|
|
some
|
|
|
|
indexOf
|
|
|
|
lastIndexOf
|
|
|
|
filter
|
2018-05-26 18:17:09 +00:00
|
|
|
flat
|
2018-02-08 10:43:13 +00:00
|
|
|
flatMap
|
2016-08-30 02:07:12 +00:00
|
|
|
reduce
|
|
|
|
reduceRight
|
|
|
|
map
|
|
|
|
keys
|
2020-01-09 06:07:29 +00:00
|
|
|
entries
|
2016-08-30 02:07:12 +00:00
|
|
|
find
|
2021-08-21 12:10:09 +00:00
|
|
|
findLast
|
2016-08-30 02:07:12 +00:00
|
|
|
findIndex
|
2021-08-21 12:10:09 +00:00
|
|
|
findLastIndex
|
2016-08-30 02:07:12 +00:00
|
|
|
includes
|
|
|
|
copyWithin
|
2020-12-08 20:15:14 +00:00
|
|
|
at
|
2016-08-30 02:07:12 +00:00
|
|
|
constructor
|
|
|
|
Symbol(Symbol.iterator)
|
|
|
|
Symbol(Symbol.unscopables)
|
|
|
|
valueOf
|
|
|
|
hasOwnProperty
|
|
|
|
propertyIsEnumerable
|
|
|
|
isPrototypeOf
|
|
|
|
__defineGetter__
|
|
|
|
__defineSetter__
|
|
|
|
__lookupGetter__
|
|
|
|
__lookupSetter__
|
|
|
|
__proto__
|
|
|
|
-----------------------------------------------------
|
|
|
|
|
2015-01-21 00:34:57 +00:00
|
|
|
-----------------------------------------------------
|
|
|
|
EXPRESSION: window.loadEvent
|
|
|
|
type: object
|
|
|
|
description: Event
|
|
|
|
|
|
|
|
OWN PROPERTIES:
|
2016-02-13 01:49:52 +00:00
|
|
|
isTrusted
|
2015-01-21 00:34:57 +00:00
|
|
|
__proto__
|
|
|
|
|
2015-02-25 00:31:42 +00:00
|
|
|
DISPLAYABLE PROPERTIES:
|
2016-02-13 01:49:52 +00:00
|
|
|
isTrusted
|
2015-01-21 00:34:57 +00:00
|
|
|
type
|
|
|
|
target
|
|
|
|
currentTarget
|
|
|
|
eventPhase
|
2017-05-04 19:55:05 +00:00
|
|
|
cancelBubble
|
2015-01-21 00:34:57 +00:00
|
|
|
bubbles
|
|
|
|
cancelable
|
2017-05-04 19:55:05 +00:00
|
|
|
defaultPrevented
|
Replace scoped flag in Event by composed flag
https://bugs.webkit.org/show_bug.cgi?id=158415
Reviewed by Chris Dumez.
Source/WebCore:
Replace `scoped` flag with `composed` flag and negate its meaning per the latest spec:
https://dom.spec.whatwg.org/#dom-event-composed
https://github.com/w3c/webcomponents/issues/513
In the old spec, every event was assumed to be "composed" (crosses shadow boundaries)
by default and there was `scoped` flag which prevented the event from crossing bondaries,
and there was a handful of events for which `scoped` was set true when dispatched by UA.
In the new spec, every event is assumed to be "scoped" and a handful of user-initiated
events set `composed` flag to true, which is also exposed in EventInit dictionary.
`relatedTargetScoped` flag has been removed. New behavior is identical to when this flag
was set to true.
No new tests since existing tests are updated to test the new flag and behavior.
* dom/CompositionEvent.cpp:
(WebCore::CompositionEvent::isCompositionEvent): Added.
* dom/CompositionEvent.h:
* dom/Event.cpp:
(WebCore::Event::Event): Initialize m_composed. Also re-ordered m_type and m_isInitialized
for better packing.
(WebCore::Event::composed): Renamed from Event::composed. We return true whenever composed
is set to true in EventInit, or the engine is dispatching an user-initiated event listed in:
https://github.com/w3c/webcomponents/issues/513#issuecomment-224183937
as well as keypress, cut, paste, and, copy as discussed in:
https://github.com/w3c/webcomponents/issues/513#issuecomment-230988170
(WebCore::Event::isCompositionEvent): Added.
* dom/Event.h:
(WebCore::Event::composed): Added.
(WebCore::Event::scoped): Deleted.
(WebCore::Event::relatedTargetScoped): Deleted.
(WebCore::Event): Reordered m_type and m_isInitialized for better packing. Added m_composed
and removed m_scoped and m_relatedTargetScoped.
* dom/Event.idl:
* dom/EventPath.cpp:
(WebCore::shouldEventCrossShadowBoundary): Returns true if the event did not originate from
a shadow tree (this event entered the current shadow tree via a slot so we need to proceed with
the normal bubble path outside the shadow tree) or composed flag is set true.
(WebCore::EventPath::EventPath): m_event no longer exists, which was only used to get the value
of relatedTargetScoped which has been removed.
(WebCore::EventPath::setRelatedTarget): Behave as if relatedTargetScoped is always set true
since the flag has been removed.
* dom/EventPath.h:
* dom/FocusEvent.cpp:
(WebCore::FocusEvent::relatedTargetScoped): Deleted.
* dom/FocusEvent.h:
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::relatedTargetScoped): Deleted.
* dom/MouseEvent.h:
LayoutTests:
Updated the tests to reflect the rename of scoped to composed and the negation of its semantics.
Now every Event is assumed to be scoped / non-composed by default, and we need to explicitly set
composed to true in order for events to cross shadow boundaries.
Also, every Event behaves as if related target is assumed to be scoped in the old terminology
althoug the flag no longer exists.
* fast/shadow-dom/Extensions-to-Event-Interface-expected.txt:
* fast/shadow-dom/Extensions-to-Event-Interface.html: Removed a test case that was testing
relatedTargetScoped to false since this flag no longer exists.
* fast/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html:
* fast/shadow-dom/event-inside-shadow-tree.html:
* fast/shadow-dom/event-inside-slotted-node.html:
* fast/shadow-dom/event-with-related-target.html:
* fast/shadow-dom/trusted-event-scoped-flags-expected.txt:
* fast/shadow-dom/trusted-event-scoped-flags.html:
* fast/xmlhttprequest/xmlhttprequest-get-expected.txt:
* http/tests/workers/worker-importScriptsOnError-expected.txt:
* inspector/model/remote-object-get-properties-expected.txt:
Canonical link: https://commits.webkit.org/177677@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-08 01:57:44 +00:00
|
|
|
composed
|
2015-01-21 00:34:57 +00:00
|
|
|
timeStamp
|
|
|
|
srcElement
|
|
|
|
returnValue
|
|
|
|
__proto__
|
|
|
|
|
|
|
|
ALL PROPERTIES:
|
2016-02-13 01:49:52 +00:00
|
|
|
isTrusted
|
2015-01-21 00:34:57 +00:00
|
|
|
constructor
|
|
|
|
type
|
|
|
|
target
|
|
|
|
currentTarget
|
|
|
|
eventPhase
|
2017-05-04 19:55:05 +00:00
|
|
|
cancelBubble
|
2015-01-21 00:34:57 +00:00
|
|
|
bubbles
|
|
|
|
cancelable
|
2017-05-04 19:55:05 +00:00
|
|
|
defaultPrevented
|
Replace scoped flag in Event by composed flag
https://bugs.webkit.org/show_bug.cgi?id=158415
Reviewed by Chris Dumez.
Source/WebCore:
Replace `scoped` flag with `composed` flag and negate its meaning per the latest spec:
https://dom.spec.whatwg.org/#dom-event-composed
https://github.com/w3c/webcomponents/issues/513
In the old spec, every event was assumed to be "composed" (crosses shadow boundaries)
by default and there was `scoped` flag which prevented the event from crossing bondaries,
and there was a handful of events for which `scoped` was set true when dispatched by UA.
In the new spec, every event is assumed to be "scoped" and a handful of user-initiated
events set `composed` flag to true, which is also exposed in EventInit dictionary.
`relatedTargetScoped` flag has been removed. New behavior is identical to when this flag
was set to true.
No new tests since existing tests are updated to test the new flag and behavior.
* dom/CompositionEvent.cpp:
(WebCore::CompositionEvent::isCompositionEvent): Added.
* dom/CompositionEvent.h:
* dom/Event.cpp:
(WebCore::Event::Event): Initialize m_composed. Also re-ordered m_type and m_isInitialized
for better packing.
(WebCore::Event::composed): Renamed from Event::composed. We return true whenever composed
is set to true in EventInit, or the engine is dispatching an user-initiated event listed in:
https://github.com/w3c/webcomponents/issues/513#issuecomment-224183937
as well as keypress, cut, paste, and, copy as discussed in:
https://github.com/w3c/webcomponents/issues/513#issuecomment-230988170
(WebCore::Event::isCompositionEvent): Added.
* dom/Event.h:
(WebCore::Event::composed): Added.
(WebCore::Event::scoped): Deleted.
(WebCore::Event::relatedTargetScoped): Deleted.
(WebCore::Event): Reordered m_type and m_isInitialized for better packing. Added m_composed
and removed m_scoped and m_relatedTargetScoped.
* dom/Event.idl:
* dom/EventPath.cpp:
(WebCore::shouldEventCrossShadowBoundary): Returns true if the event did not originate from
a shadow tree (this event entered the current shadow tree via a slot so we need to proceed with
the normal bubble path outside the shadow tree) or composed flag is set true.
(WebCore::EventPath::EventPath): m_event no longer exists, which was only used to get the value
of relatedTargetScoped which has been removed.
(WebCore::EventPath::setRelatedTarget): Behave as if relatedTargetScoped is always set true
since the flag has been removed.
* dom/EventPath.h:
* dom/FocusEvent.cpp:
(WebCore::FocusEvent::relatedTargetScoped): Deleted.
* dom/FocusEvent.h:
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::relatedTargetScoped): Deleted.
* dom/MouseEvent.h:
LayoutTests:
Updated the tests to reflect the rename of scoped to composed and the negation of its semantics.
Now every Event is assumed to be scoped / non-composed by default, and we need to explicitly set
composed to true in order for events to cross shadow boundaries.
Also, every Event behaves as if related target is assumed to be scoped in the old terminology
althoug the flag no longer exists.
* fast/shadow-dom/Extensions-to-Event-Interface-expected.txt:
* fast/shadow-dom/Extensions-to-Event-Interface.html: Removed a test case that was testing
relatedTargetScoped to false since this flag no longer exists.
* fast/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html:
* fast/shadow-dom/event-inside-shadow-tree.html:
* fast/shadow-dom/event-inside-slotted-node.html:
* fast/shadow-dom/event-with-related-target.html:
* fast/shadow-dom/trusted-event-scoped-flags-expected.txt:
* fast/shadow-dom/trusted-event-scoped-flags.html:
* fast/xmlhttprequest/xmlhttprequest-get-expected.txt:
* http/tests/workers/worker-importScriptsOnError-expected.txt:
* inspector/model/remote-object-get-properties-expected.txt:
Canonical link: https://commits.webkit.org/177677@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-07-08 01:57:44 +00:00
|
|
|
composed
|
2015-01-21 00:34:57 +00:00
|
|
|
timeStamp
|
|
|
|
srcElement
|
|
|
|
returnValue
|
2016-05-09 20:10:59 +00:00
|
|
|
composedPath
|
2016-02-16 20:23:02 +00:00
|
|
|
stopPropagation
|
2017-05-04 19:55:05 +00:00
|
|
|
stopImmediatePropagation
|
2016-02-16 20:23:02 +00:00
|
|
|
preventDefault
|
|
|
|
initEvent
|
2015-01-21 00:34:57 +00:00
|
|
|
NONE
|
|
|
|
CAPTURING_PHASE
|
|
|
|
AT_TARGET
|
|
|
|
BUBBLING_PHASE
|
2020-05-01 09:48:33 +00:00
|
|
|
Symbol(Symbol.toStringTag)
|
2015-01-21 00:34:57 +00:00
|
|
|
toString
|
|
|
|
toLocaleString
|
|
|
|
valueOf
|
|
|
|
hasOwnProperty
|
|
|
|
propertyIsEnumerable
|
|
|
|
isPrototypeOf
|
|
|
|
__defineGetter__
|
|
|
|
__defineSetter__
|
|
|
|
__lookupGetter__
|
|
|
|
__lookupSetter__
|
|
|
|
__proto__
|
|
|
|
-----------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------
|
|
|
|
EXPRESSION: window.complexObject
|
|
|
|
type: object
|
|
|
|
description: SuperFoo
|
|
|
|
|
|
|
|
OWN PROPERTIES:
|
|
|
|
_bar
|
|
|
|
_foo
|
|
|
|
__proto__
|
|
|
|
|
2015-02-25 00:31:42 +00:00
|
|
|
DISPLAYABLE PROPERTIES:
|
2015-01-21 00:34:57 +00:00
|
|
|
_bar
|
|
|
|
_foo
|
|
|
|
__proto__
|
|
|
|
|
|
|
|
ALL PROPERTIES:
|
|
|
|
_bar
|
|
|
|
_foo
|
|
|
|
constructor
|
Web Inspector: Create Separate Model and View Objects for RemoteObjects / ObjectPreview / PropertyDescriptor
https://bugs.webkit.org/show_bug.cgi?id=141696
Reviewed by Timothy Hatcher.
Source/WebInspectorUI:
* UserInterface/Main.html:
Add new files.
* UserInterface/Models/CollectionEntry.js: Added.
(WebInspector.CollectionEntry):
(WebInspector.CollectionEntry.fromPayload):
(WebInspector.CollectionEntry.prototype.get key):
(WebInspector.CollectionEntry.prototype.get value):
* UserInterface/Models/CollectionEntryPreview.js: Added.
(WebInspector.CollectionEntryPreview):
(WebInspector.CollectionEntryPreview.fromPayload):
(WebInspector.CollectionEntryPreview.prototype.get keyPreview):
(WebInspector.CollectionEntryPreview.prototype.get valuePreview):
* UserInterface/Models/ObjectPreview.js: Added.
(WebInspector.ObjectPreview):
(WebInspector.ObjectPreview.fromPayload):
(WebInspector.ObjectPreview.prototype.get type):
(WebInspector.ObjectPreview.prototype.get subtype):
(WebInspector.ObjectPreview.prototype.get description):
(WebInspector.ObjectPreview.prototype.get lossless):
(WebInspector.ObjectPreview.prototype.get overflow):
(WebInspector.ObjectPreview.prototype.get properties):
(WebInspector.ObjectPreview.prototype.get entries):
* UserInterface/Models/PropertyPreview.js: Added.
(WebInspector.PropertyPreview):
(WebInspector.PropertyPreview.fromPayload):
(WebInspector.PropertyPreview.prototype.get name):
(WebInspector.PropertyPreview.prototype.get type):
(WebInspector.PropertyPreview.prototype.get subtype):
(WebInspector.PropertyPreview.prototype.get value):
(WebInspector.PropertyPreview.prototype.get valuePreview):
* UserInterface/Models/PropertyDescriptor.js: Added.
(WebInspector.PropertyDescriptor.fromPayload):
(WebInspector.PropertyDescriptor.prototype.get name):
(WebInspector.PropertyDescriptor.prototype.get value):
(WebInspector.PropertyDescriptor.prototype.get writable):
(WebInspector.PropertyDescriptor.prototype.get configurable):
(WebInspector.PropertyDescriptor.prototype.get enumerable):
(WebInspector.PropertyDescriptor.prototype.get isOwnProperty):
(WebInspector.PropertyDescriptor.prototype.get wasThrown):
(WebInspector.PropertyDescriptor.prototype.get isInternalProperty):
(WebInspector.PropertyDescriptor.prototype.hasValue):
(WebInspector.PropertyDescriptor.prototype.hasGetter):
(WebInspector.PropertyDescriptor.prototype.hasSetter):
New Model objects for different Protocol types.
The only customizations right now are compatibility modifications
and PropertyDescriptor's "hasValue", "hasGetter", and "hasSetter"
functions to return reliable checks based on the descriptors contents.
* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject):
(WebInspector.RemoteObject.fromPayload):
(WebInspector.RemoteObject.resolveNode):
(WebInspector.RemoteObject.prototype.get value):
(WebInspector.RemoteObject.prototype._isSymbol):
(WebInspector.RemoteObject.prototype.isCollectionType):
(WebInspector.RemoteObject.prototype.isWeakCollection):
(WebInspector.RemoteObject.prototype.getCollectionEntries):
(WebInspector.RemoteObject.prototype.arrayLength):
Clean up the existing code to enforce more checks and use our
style of member variables and public accessors.
(WebInspector.RemoteObject.prototype.getOwnPropertyDescriptors):
(WebInspector.RemoteObject.prototype.getOwnAndGetterPropertyDescriptors):
(WebInspector.RemoteObject.prototype.getAllPropertyDescriptors):
(WebInspector.RemoteObject.prototype.callback):
Provide a new way of getting properties that returns Model objects
instead of raw protocol types.
* UserInterface/Views/ConsoleMessageImpl.js:
(WebInspector.ConsoleMessageImpl.prototype._format):
(WebInspector.ConsoleMessageImpl.prototype._formatParameter):
(WebInspector.ConsoleMessageImpl.prototype._propertyPreviewElement):
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsNode):
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsTable):
(WebInspector.ConsoleMessageImpl.prototype._formatAsArrayEntry):
Always include a preview when possible. Now, when forced to be an object,
force expansion even if the preview is lossless.
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsObject):
Use an ObjectTreeView instead of ObjectPropertiesSection.
(WebInspector.ConsoleMessageImpl.prototype._appendPreview): Deleted.
(WebInspector.ConsoleMessageImpl.prototype._appendEntryPreviews): Deleted.
(WebInspector.ConsoleMessageImpl.prototype._appendPropertyPreviews): Deleted.
(WebInspector.ConsoleMessageImpl.prototype._appendValuePreview): Deleted.
This code is moved into ObjectPreviewView.
* UserInterface/Views/ObjectPropertiesSection.js:
(WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand.callback):
(WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand):
These types are now converted to Model types in Model objects, so do not do it here.
* UserInterface/Views/ObjectPreviewView.css: Added.
(.object-preview):
(.object-preview.lossless):
(.object-preview .name):
* UserInterface/Views/ObjectPreviewView.js: Added.
(WebInspector.ObjectPreviewView):
(WebInspector.ObjectPreviewView.prototype.get preview):
(WebInspector.ObjectPreviewView.prototype.get element):
(WebInspector.ObjectPreviewView.prototype.get mode):
(WebInspector.ObjectPreviewView.prototype.get lossless):
(WebInspector.ObjectPreviewView.prototype._numberOfPropertiesToShowInMode):
(WebInspector.ObjectPreviewView.prototype._appendPreview):
(WebInspector.ObjectPreviewView.prototype._appendEntryPreviews):
(WebInspector.ObjectPreviewView.prototype._appendPropertyPreviews):
(WebInspector.ObjectPreviewView.prototype._appendValuePreview):
(WebInspector.ObjectPreviewView.prototype._formattedObjectElementForPreview):
An ObjectPreviewView can create a full/brief view given a ObjectPreview.
The view will contain formatted values everywhere possible.
* UserInterface/Views/ObjectTreePropertyTreeElement.js: Added.
(WebInspector.ObjectTreePropertyTreeElement):
(WebInspector.ObjectTreePropertyTreeElement.prototype.get property):
(WebInspector.ObjectTreePropertyTreeElement.prototype.onpopulate):
(WebInspector.ObjectTreePropertyTreeElement.prototype.onattach):
(WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitle):
(WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitlePropertyStyle):
(WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitleAPIStyle):
(WebInspector.ObjectTreePropertyTreeElement.prototype._descriptionString):
(WebInspector.ObjectTreePropertyTreeElement.prototype._functionParameterString):
(WebInspector.ObjectTreePropertyTreeElement.prototype.mode):
(WebInspector.ObjectTreePropertyTreeElement.prototype):
* UserInterface/Views/ObjectTreeView.js: Added.
(WebInspector.ObjectTreeView):
(WebInspector.ObjectTreeView.classNameForObject):
(WebInspector.ObjectTreeView.ComparePropertyDescriptors):
(WebInspector.ObjectTreeView.prototype.get object):
(WebInspector.ObjectTreeView.prototype.get element):
(WebInspector.ObjectTreeView.prototype.get expanded):
(WebInspector.ObjectTreeView.prototype.expand):
(WebInspector.ObjectTreeView.prototype.collapse):
(WebInspector.ObjectTreeView.prototype.update):
(WebInspector.ObjectTreeView.prototype._updateProperties):
(WebInspector.ObjectTreeView.prototype._handlePreviewOrTitleElementClick):
Re-implementation of ObjectPropertiesSection for our Model objects
without "Section" semantics / dependencies. An ObjectTree will creates
an expandable tree for a RemoteObject. The top level clickable item
will be an ObjectPreview if possible, otherwise just a title element.
* UserInterface/Views/ObjectTreeView.css: Added.
(.object-tree):
(.object-tree > .title):
(.object-tree > :matches(.title, .object-preview)::before):
(.object-tree.expanded > :matches(.title, .object-preview)::before):
(.object-tree.lossless-preview > :matches(.title, .object-preview)::before):
(.object-tree-outline):
(.object-tree.expanded > .object-tree-outline):
(.object-tree-outline li):
(.object-tree-outline li.parent):
(.object-tree-outline li.parent::before):
(.object-tree-outline li.parent.expanded::before):
(.object-tree-outline ol):
(.object-tree-outline ol.expanded):
(.object-tree-outline li .empty-message):
(.object-tree-property .name):
(.object-tree-property .name.not-enumerable):
(.object-tree-property .value.error):
(.formatted-object, .formatted-node, .formatted-error, .formatted-map, .formatted-set, .formatted-weakmap):
(.formatted-number):
(.formatted-string, .formatted-regexp):
(.formatted-string):
(.formatted-regexp):
(.formatted-symbol):
(.formatted-null, .formatted-undefined):
(.console-group-messages .object-tree:not(.lossless-preview)):
(.console-group-messages .object-tree:not(.lossless-preview) > :matches(.title, .object-preview)):
(.console-group-messages .object-tree:not(.lossless-preview) > :matches(.title, .object-preview)::before):
(.console-group-messages :matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .object-tree):
(.console-group-messages :matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .object-tree-outline):
All styles for ObjectTree / ObjectPreview. Independent from
other styles in the inspector. Most of this is a copy of
the styles applied to ObjectPropertiesSection, renamed.
* UserInterface/Views/ObjectTreeCollectionTreeElement.js: Added.
(WebInspector.ObjectTreeCollectionTreeElement):
(WebInspector.ObjectTreeCollectionTreeElement.propertyDescriptorForEntry):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.get remoteObject):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.onexpand.callback):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.onexpand):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.oncollapse):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.ondetach):
(WebInspector.ObjectTreeCollectionTreeElement.prototype._trackWeakEntries):
(WebInspector.ObjectTreeCollectionTreeElement.prototype._untrackWeakEntries):
(WebInspector.ObjectTreeCollectionEntryTreeElement):
(WebInspector.ObjectTreeCollectionEntryTreeElement.prototype.onpopulate):
(WebInspector.ObjectTreeCollectionEntryTreeElement.prototype.onattach):
(WebInspector.ObjectTreeEmptyCollectionTreeElement):
Essentially a copy of ObjectPropertiesSection Collection handling using
the ObjectTree class names.
* UserInterface/Views/TreeOutlineDataGridSynchronizer.js:
Fix prototype typo.
LayoutTests:
* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/model/remote-object-get-properties.html:
* inspector/model/remote-object-weak-collection-expected.txt:
* inspector/model/remote-object-weak-collection.html:
Update tests and results to use our Model objects and not
raw protocol types.
Canonical link: https://commits.webkit.org/159826@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-19 20:25:04 +00:00
|
|
|
getterProperty
|
|
|
|
foo
|
2015-01-21 00:34:57 +00:00
|
|
|
BAR_CONSTANT
|
Web Inspector: Create Separate Model and View Objects for RemoteObjects / ObjectPreview / PropertyDescriptor
https://bugs.webkit.org/show_bug.cgi?id=141696
Reviewed by Timothy Hatcher.
Source/WebInspectorUI:
* UserInterface/Main.html:
Add new files.
* UserInterface/Models/CollectionEntry.js: Added.
(WebInspector.CollectionEntry):
(WebInspector.CollectionEntry.fromPayload):
(WebInspector.CollectionEntry.prototype.get key):
(WebInspector.CollectionEntry.prototype.get value):
* UserInterface/Models/CollectionEntryPreview.js: Added.
(WebInspector.CollectionEntryPreview):
(WebInspector.CollectionEntryPreview.fromPayload):
(WebInspector.CollectionEntryPreview.prototype.get keyPreview):
(WebInspector.CollectionEntryPreview.prototype.get valuePreview):
* UserInterface/Models/ObjectPreview.js: Added.
(WebInspector.ObjectPreview):
(WebInspector.ObjectPreview.fromPayload):
(WebInspector.ObjectPreview.prototype.get type):
(WebInspector.ObjectPreview.prototype.get subtype):
(WebInspector.ObjectPreview.prototype.get description):
(WebInspector.ObjectPreview.prototype.get lossless):
(WebInspector.ObjectPreview.prototype.get overflow):
(WebInspector.ObjectPreview.prototype.get properties):
(WebInspector.ObjectPreview.prototype.get entries):
* UserInterface/Models/PropertyPreview.js: Added.
(WebInspector.PropertyPreview):
(WebInspector.PropertyPreview.fromPayload):
(WebInspector.PropertyPreview.prototype.get name):
(WebInspector.PropertyPreview.prototype.get type):
(WebInspector.PropertyPreview.prototype.get subtype):
(WebInspector.PropertyPreview.prototype.get value):
(WebInspector.PropertyPreview.prototype.get valuePreview):
* UserInterface/Models/PropertyDescriptor.js: Added.
(WebInspector.PropertyDescriptor.fromPayload):
(WebInspector.PropertyDescriptor.prototype.get name):
(WebInspector.PropertyDescriptor.prototype.get value):
(WebInspector.PropertyDescriptor.prototype.get writable):
(WebInspector.PropertyDescriptor.prototype.get configurable):
(WebInspector.PropertyDescriptor.prototype.get enumerable):
(WebInspector.PropertyDescriptor.prototype.get isOwnProperty):
(WebInspector.PropertyDescriptor.prototype.get wasThrown):
(WebInspector.PropertyDescriptor.prototype.get isInternalProperty):
(WebInspector.PropertyDescriptor.prototype.hasValue):
(WebInspector.PropertyDescriptor.prototype.hasGetter):
(WebInspector.PropertyDescriptor.prototype.hasSetter):
New Model objects for different Protocol types.
The only customizations right now are compatibility modifications
and PropertyDescriptor's "hasValue", "hasGetter", and "hasSetter"
functions to return reliable checks based on the descriptors contents.
* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject):
(WebInspector.RemoteObject.fromPayload):
(WebInspector.RemoteObject.resolveNode):
(WebInspector.RemoteObject.prototype.get value):
(WebInspector.RemoteObject.prototype._isSymbol):
(WebInspector.RemoteObject.prototype.isCollectionType):
(WebInspector.RemoteObject.prototype.isWeakCollection):
(WebInspector.RemoteObject.prototype.getCollectionEntries):
(WebInspector.RemoteObject.prototype.arrayLength):
Clean up the existing code to enforce more checks and use our
style of member variables and public accessors.
(WebInspector.RemoteObject.prototype.getOwnPropertyDescriptors):
(WebInspector.RemoteObject.prototype.getOwnAndGetterPropertyDescriptors):
(WebInspector.RemoteObject.prototype.getAllPropertyDescriptors):
(WebInspector.RemoteObject.prototype.callback):
Provide a new way of getting properties that returns Model objects
instead of raw protocol types.
* UserInterface/Views/ConsoleMessageImpl.js:
(WebInspector.ConsoleMessageImpl.prototype._format):
(WebInspector.ConsoleMessageImpl.prototype._formatParameter):
(WebInspector.ConsoleMessageImpl.prototype._propertyPreviewElement):
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsNode):
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsTable):
(WebInspector.ConsoleMessageImpl.prototype._formatAsArrayEntry):
Always include a preview when possible. Now, when forced to be an object,
force expansion even if the preview is lossless.
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsObject):
Use an ObjectTreeView instead of ObjectPropertiesSection.
(WebInspector.ConsoleMessageImpl.prototype._appendPreview): Deleted.
(WebInspector.ConsoleMessageImpl.prototype._appendEntryPreviews): Deleted.
(WebInspector.ConsoleMessageImpl.prototype._appendPropertyPreviews): Deleted.
(WebInspector.ConsoleMessageImpl.prototype._appendValuePreview): Deleted.
This code is moved into ObjectPreviewView.
* UserInterface/Views/ObjectPropertiesSection.js:
(WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand.callback):
(WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand):
These types are now converted to Model types in Model objects, so do not do it here.
* UserInterface/Views/ObjectPreviewView.css: Added.
(.object-preview):
(.object-preview.lossless):
(.object-preview .name):
* UserInterface/Views/ObjectPreviewView.js: Added.
(WebInspector.ObjectPreviewView):
(WebInspector.ObjectPreviewView.prototype.get preview):
(WebInspector.ObjectPreviewView.prototype.get element):
(WebInspector.ObjectPreviewView.prototype.get mode):
(WebInspector.ObjectPreviewView.prototype.get lossless):
(WebInspector.ObjectPreviewView.prototype._numberOfPropertiesToShowInMode):
(WebInspector.ObjectPreviewView.prototype._appendPreview):
(WebInspector.ObjectPreviewView.prototype._appendEntryPreviews):
(WebInspector.ObjectPreviewView.prototype._appendPropertyPreviews):
(WebInspector.ObjectPreviewView.prototype._appendValuePreview):
(WebInspector.ObjectPreviewView.prototype._formattedObjectElementForPreview):
An ObjectPreviewView can create a full/brief view given a ObjectPreview.
The view will contain formatted values everywhere possible.
* UserInterface/Views/ObjectTreePropertyTreeElement.js: Added.
(WebInspector.ObjectTreePropertyTreeElement):
(WebInspector.ObjectTreePropertyTreeElement.prototype.get property):
(WebInspector.ObjectTreePropertyTreeElement.prototype.onpopulate):
(WebInspector.ObjectTreePropertyTreeElement.prototype.onattach):
(WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitle):
(WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitlePropertyStyle):
(WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitleAPIStyle):
(WebInspector.ObjectTreePropertyTreeElement.prototype._descriptionString):
(WebInspector.ObjectTreePropertyTreeElement.prototype._functionParameterString):
(WebInspector.ObjectTreePropertyTreeElement.prototype.mode):
(WebInspector.ObjectTreePropertyTreeElement.prototype):
* UserInterface/Views/ObjectTreeView.js: Added.
(WebInspector.ObjectTreeView):
(WebInspector.ObjectTreeView.classNameForObject):
(WebInspector.ObjectTreeView.ComparePropertyDescriptors):
(WebInspector.ObjectTreeView.prototype.get object):
(WebInspector.ObjectTreeView.prototype.get element):
(WebInspector.ObjectTreeView.prototype.get expanded):
(WebInspector.ObjectTreeView.prototype.expand):
(WebInspector.ObjectTreeView.prototype.collapse):
(WebInspector.ObjectTreeView.prototype.update):
(WebInspector.ObjectTreeView.prototype._updateProperties):
(WebInspector.ObjectTreeView.prototype._handlePreviewOrTitleElementClick):
Re-implementation of ObjectPropertiesSection for our Model objects
without "Section" semantics / dependencies. An ObjectTree will creates
an expandable tree for a RemoteObject. The top level clickable item
will be an ObjectPreview if possible, otherwise just a title element.
* UserInterface/Views/ObjectTreeView.css: Added.
(.object-tree):
(.object-tree > .title):
(.object-tree > :matches(.title, .object-preview)::before):
(.object-tree.expanded > :matches(.title, .object-preview)::before):
(.object-tree.lossless-preview > :matches(.title, .object-preview)::before):
(.object-tree-outline):
(.object-tree.expanded > .object-tree-outline):
(.object-tree-outline li):
(.object-tree-outline li.parent):
(.object-tree-outline li.parent::before):
(.object-tree-outline li.parent.expanded::before):
(.object-tree-outline ol):
(.object-tree-outline ol.expanded):
(.object-tree-outline li .empty-message):
(.object-tree-property .name):
(.object-tree-property .name.not-enumerable):
(.object-tree-property .value.error):
(.formatted-object, .formatted-node, .formatted-error, .formatted-map, .formatted-set, .formatted-weakmap):
(.formatted-number):
(.formatted-string, .formatted-regexp):
(.formatted-string):
(.formatted-regexp):
(.formatted-symbol):
(.formatted-null, .formatted-undefined):
(.console-group-messages .object-tree:not(.lossless-preview)):
(.console-group-messages .object-tree:not(.lossless-preview) > :matches(.title, .object-preview)):
(.console-group-messages .object-tree:not(.lossless-preview) > :matches(.title, .object-preview)::before):
(.console-group-messages :matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .object-tree):
(.console-group-messages :matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .object-tree-outline):
All styles for ObjectTree / ObjectPreview. Independent from
other styles in the inspector. Most of this is a copy of
the styles applied to ObjectPropertiesSection, renamed.
* UserInterface/Views/ObjectTreeCollectionTreeElement.js: Added.
(WebInspector.ObjectTreeCollectionTreeElement):
(WebInspector.ObjectTreeCollectionTreeElement.propertyDescriptorForEntry):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.get remoteObject):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.onexpand.callback):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.onexpand):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.oncollapse):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.ondetach):
(WebInspector.ObjectTreeCollectionTreeElement.prototype._trackWeakEntries):
(WebInspector.ObjectTreeCollectionTreeElement.prototype._untrackWeakEntries):
(WebInspector.ObjectTreeCollectionEntryTreeElement):
(WebInspector.ObjectTreeCollectionEntryTreeElement.prototype.onpopulate):
(WebInspector.ObjectTreeCollectionEntryTreeElement.prototype.onattach):
(WebInspector.ObjectTreeEmptyCollectionTreeElement):
Essentially a copy of ObjectPropertiesSection Collection handling using
the ObjectTree class names.
* UserInterface/Views/TreeOutlineDataGridSynchronizer.js:
Fix prototype typo.
LayoutTests:
* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/model/remote-object-get-properties.html:
* inspector/model/remote-object-weak-collection-expected.txt:
* inspector/model/remote-object-weak-collection.html:
Update tests and results to use our Model objects and not
raw protocol types.
Canonical link: https://commits.webkit.org/159826@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-19 20:25:04 +00:00
|
|
|
bar
|
|
|
|
setterOnly
|
2015-01-21 00:34:57 +00:00
|
|
|
toString
|
|
|
|
toLocaleString
|
|
|
|
valueOf
|
|
|
|
hasOwnProperty
|
|
|
|
propertyIsEnumerable
|
|
|
|
isPrototypeOf
|
|
|
|
__defineGetter__
|
|
|
|
__defineSetter__
|
|
|
|
__lookupGetter__
|
|
|
|
__lookupSetter__
|
|
|
|
__proto__
|
|
|
|
-----------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------
|
|
|
|
EXPRESSION: window.badGetterObject
|
|
|
|
type: object
|
|
|
|
description: ClassWithBadGetter
|
|
|
|
|
|
|
|
OWN PROPERTIES:
|
|
|
|
__proto__
|
|
|
|
|
2015-02-25 00:31:42 +00:00
|
|
|
DISPLAYABLE PROPERTIES:
|
2015-01-21 00:34:57 +00:00
|
|
|
__proto__
|
|
|
|
|
|
|
|
ALL PROPERTIES:
|
|
|
|
constructor
|
Web Inspector: Create Separate Model and View Objects for RemoteObjects / ObjectPreview / PropertyDescriptor
https://bugs.webkit.org/show_bug.cgi?id=141696
Reviewed by Timothy Hatcher.
Source/WebInspectorUI:
* UserInterface/Main.html:
Add new files.
* UserInterface/Models/CollectionEntry.js: Added.
(WebInspector.CollectionEntry):
(WebInspector.CollectionEntry.fromPayload):
(WebInspector.CollectionEntry.prototype.get key):
(WebInspector.CollectionEntry.prototype.get value):
* UserInterface/Models/CollectionEntryPreview.js: Added.
(WebInspector.CollectionEntryPreview):
(WebInspector.CollectionEntryPreview.fromPayload):
(WebInspector.CollectionEntryPreview.prototype.get keyPreview):
(WebInspector.CollectionEntryPreview.prototype.get valuePreview):
* UserInterface/Models/ObjectPreview.js: Added.
(WebInspector.ObjectPreview):
(WebInspector.ObjectPreview.fromPayload):
(WebInspector.ObjectPreview.prototype.get type):
(WebInspector.ObjectPreview.prototype.get subtype):
(WebInspector.ObjectPreview.prototype.get description):
(WebInspector.ObjectPreview.prototype.get lossless):
(WebInspector.ObjectPreview.prototype.get overflow):
(WebInspector.ObjectPreview.prototype.get properties):
(WebInspector.ObjectPreview.prototype.get entries):
* UserInterface/Models/PropertyPreview.js: Added.
(WebInspector.PropertyPreview):
(WebInspector.PropertyPreview.fromPayload):
(WebInspector.PropertyPreview.prototype.get name):
(WebInspector.PropertyPreview.prototype.get type):
(WebInspector.PropertyPreview.prototype.get subtype):
(WebInspector.PropertyPreview.prototype.get value):
(WebInspector.PropertyPreview.prototype.get valuePreview):
* UserInterface/Models/PropertyDescriptor.js: Added.
(WebInspector.PropertyDescriptor.fromPayload):
(WebInspector.PropertyDescriptor.prototype.get name):
(WebInspector.PropertyDescriptor.prototype.get value):
(WebInspector.PropertyDescriptor.prototype.get writable):
(WebInspector.PropertyDescriptor.prototype.get configurable):
(WebInspector.PropertyDescriptor.prototype.get enumerable):
(WebInspector.PropertyDescriptor.prototype.get isOwnProperty):
(WebInspector.PropertyDescriptor.prototype.get wasThrown):
(WebInspector.PropertyDescriptor.prototype.get isInternalProperty):
(WebInspector.PropertyDescriptor.prototype.hasValue):
(WebInspector.PropertyDescriptor.prototype.hasGetter):
(WebInspector.PropertyDescriptor.prototype.hasSetter):
New Model objects for different Protocol types.
The only customizations right now are compatibility modifications
and PropertyDescriptor's "hasValue", "hasGetter", and "hasSetter"
functions to return reliable checks based on the descriptors contents.
* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject):
(WebInspector.RemoteObject.fromPayload):
(WebInspector.RemoteObject.resolveNode):
(WebInspector.RemoteObject.prototype.get value):
(WebInspector.RemoteObject.prototype._isSymbol):
(WebInspector.RemoteObject.prototype.isCollectionType):
(WebInspector.RemoteObject.prototype.isWeakCollection):
(WebInspector.RemoteObject.prototype.getCollectionEntries):
(WebInspector.RemoteObject.prototype.arrayLength):
Clean up the existing code to enforce more checks and use our
style of member variables and public accessors.
(WebInspector.RemoteObject.prototype.getOwnPropertyDescriptors):
(WebInspector.RemoteObject.prototype.getOwnAndGetterPropertyDescriptors):
(WebInspector.RemoteObject.prototype.getAllPropertyDescriptors):
(WebInspector.RemoteObject.prototype.callback):
Provide a new way of getting properties that returns Model objects
instead of raw protocol types.
* UserInterface/Views/ConsoleMessageImpl.js:
(WebInspector.ConsoleMessageImpl.prototype._format):
(WebInspector.ConsoleMessageImpl.prototype._formatParameter):
(WebInspector.ConsoleMessageImpl.prototype._propertyPreviewElement):
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsNode):
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsTable):
(WebInspector.ConsoleMessageImpl.prototype._formatAsArrayEntry):
Always include a preview when possible. Now, when forced to be an object,
force expansion even if the preview is lossless.
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsObject):
Use an ObjectTreeView instead of ObjectPropertiesSection.
(WebInspector.ConsoleMessageImpl.prototype._appendPreview): Deleted.
(WebInspector.ConsoleMessageImpl.prototype._appendEntryPreviews): Deleted.
(WebInspector.ConsoleMessageImpl.prototype._appendPropertyPreviews): Deleted.
(WebInspector.ConsoleMessageImpl.prototype._appendValuePreview): Deleted.
This code is moved into ObjectPreviewView.
* UserInterface/Views/ObjectPropertiesSection.js:
(WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand.callback):
(WebInspector.CollectionEntriesMainTreeElement.prototype.onexpand):
These types are now converted to Model types in Model objects, so do not do it here.
* UserInterface/Views/ObjectPreviewView.css: Added.
(.object-preview):
(.object-preview.lossless):
(.object-preview .name):
* UserInterface/Views/ObjectPreviewView.js: Added.
(WebInspector.ObjectPreviewView):
(WebInspector.ObjectPreviewView.prototype.get preview):
(WebInspector.ObjectPreviewView.prototype.get element):
(WebInspector.ObjectPreviewView.prototype.get mode):
(WebInspector.ObjectPreviewView.prototype.get lossless):
(WebInspector.ObjectPreviewView.prototype._numberOfPropertiesToShowInMode):
(WebInspector.ObjectPreviewView.prototype._appendPreview):
(WebInspector.ObjectPreviewView.prototype._appendEntryPreviews):
(WebInspector.ObjectPreviewView.prototype._appendPropertyPreviews):
(WebInspector.ObjectPreviewView.prototype._appendValuePreview):
(WebInspector.ObjectPreviewView.prototype._formattedObjectElementForPreview):
An ObjectPreviewView can create a full/brief view given a ObjectPreview.
The view will contain formatted values everywhere possible.
* UserInterface/Views/ObjectTreePropertyTreeElement.js: Added.
(WebInspector.ObjectTreePropertyTreeElement):
(WebInspector.ObjectTreePropertyTreeElement.prototype.get property):
(WebInspector.ObjectTreePropertyTreeElement.prototype.onpopulate):
(WebInspector.ObjectTreePropertyTreeElement.prototype.onattach):
(WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitle):
(WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitlePropertyStyle):
(WebInspector.ObjectTreePropertyTreeElement.prototype._updateTitleAPIStyle):
(WebInspector.ObjectTreePropertyTreeElement.prototype._descriptionString):
(WebInspector.ObjectTreePropertyTreeElement.prototype._functionParameterString):
(WebInspector.ObjectTreePropertyTreeElement.prototype.mode):
(WebInspector.ObjectTreePropertyTreeElement.prototype):
* UserInterface/Views/ObjectTreeView.js: Added.
(WebInspector.ObjectTreeView):
(WebInspector.ObjectTreeView.classNameForObject):
(WebInspector.ObjectTreeView.ComparePropertyDescriptors):
(WebInspector.ObjectTreeView.prototype.get object):
(WebInspector.ObjectTreeView.prototype.get element):
(WebInspector.ObjectTreeView.prototype.get expanded):
(WebInspector.ObjectTreeView.prototype.expand):
(WebInspector.ObjectTreeView.prototype.collapse):
(WebInspector.ObjectTreeView.prototype.update):
(WebInspector.ObjectTreeView.prototype._updateProperties):
(WebInspector.ObjectTreeView.prototype._handlePreviewOrTitleElementClick):
Re-implementation of ObjectPropertiesSection for our Model objects
without "Section" semantics / dependencies. An ObjectTree will creates
an expandable tree for a RemoteObject. The top level clickable item
will be an ObjectPreview if possible, otherwise just a title element.
* UserInterface/Views/ObjectTreeView.css: Added.
(.object-tree):
(.object-tree > .title):
(.object-tree > :matches(.title, .object-preview)::before):
(.object-tree.expanded > :matches(.title, .object-preview)::before):
(.object-tree.lossless-preview > :matches(.title, .object-preview)::before):
(.object-tree-outline):
(.object-tree.expanded > .object-tree-outline):
(.object-tree-outline li):
(.object-tree-outline li.parent):
(.object-tree-outline li.parent::before):
(.object-tree-outline li.parent.expanded::before):
(.object-tree-outline ol):
(.object-tree-outline ol.expanded):
(.object-tree-outline li .empty-message):
(.object-tree-property .name):
(.object-tree-property .name.not-enumerable):
(.object-tree-property .value.error):
(.formatted-object, .formatted-node, .formatted-error, .formatted-map, .formatted-set, .formatted-weakmap):
(.formatted-number):
(.formatted-string, .formatted-regexp):
(.formatted-string):
(.formatted-regexp):
(.formatted-symbol):
(.formatted-null, .formatted-undefined):
(.console-group-messages .object-tree:not(.lossless-preview)):
(.console-group-messages .object-tree:not(.lossless-preview) > :matches(.title, .object-preview)):
(.console-group-messages .object-tree:not(.lossless-preview) > :matches(.title, .object-preview)::before):
(.console-group-messages :matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .object-tree):
(.console-group-messages :matches(.console-formatted-object, .console-formatted-node, .console-formatted-error, .console-formatted-map, .console-formatted-set, .console-formatted-weakmap) .object-tree-outline):
All styles for ObjectTree / ObjectPreview. Independent from
other styles in the inspector. Most of this is a copy of
the styles applied to ObjectPropertiesSection, renamed.
* UserInterface/Views/ObjectTreeCollectionTreeElement.js: Added.
(WebInspector.ObjectTreeCollectionTreeElement):
(WebInspector.ObjectTreeCollectionTreeElement.propertyDescriptorForEntry):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.get remoteObject):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.onexpand.callback):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.onexpand):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.oncollapse):
(WebInspector.ObjectTreeCollectionTreeElement.prototype.ondetach):
(WebInspector.ObjectTreeCollectionTreeElement.prototype._trackWeakEntries):
(WebInspector.ObjectTreeCollectionTreeElement.prototype._untrackWeakEntries):
(WebInspector.ObjectTreeCollectionEntryTreeElement):
(WebInspector.ObjectTreeCollectionEntryTreeElement.prototype.onpopulate):
(WebInspector.ObjectTreeCollectionEntryTreeElement.prototype.onattach):
(WebInspector.ObjectTreeEmptyCollectionTreeElement):
Essentially a copy of ObjectPropertiesSection Collection handling using
the ObjectTree class names.
* UserInterface/Views/TreeOutlineDataGridSynchronizer.js:
Fix prototype typo.
LayoutTests:
* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/model/remote-object-get-properties.html:
* inspector/model/remote-object-weak-collection-expected.txt:
* inspector/model/remote-object-weak-collection.html:
Update tests and results to use our Model objects and not
raw protocol types.
Canonical link: https://commits.webkit.org/159826@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-02-19 20:25:04 +00:00
|
|
|
badGetter
|
2015-01-21 00:34:57 +00:00
|
|
|
toString
|
|
|
|
toLocaleString
|
|
|
|
valueOf
|
|
|
|
hasOwnProperty
|
|
|
|
propertyIsEnumerable
|
|
|
|
isPrototypeOf
|
|
|
|
__defineGetter__
|
|
|
|
__defineSetter__
|
|
|
|
__lookupGetter__
|
|
|
|
__lookupSetter__
|
|
|
|
__proto__
|
|
|
|
-----------------------------------------------------
|
2015-02-17 20:17:28 +00:00
|
|
|
|
|
|
|
-----------------------------------------------------
|
|
|
|
EXPRESSION: window.unboundFunction
|
|
|
|
type: function
|
|
|
|
description: function () { console.log(arguments); }
|
|
|
|
|
|
|
|
OWN PROPERTIES:
|
Partly implement Function.prototype.{caller,arguments} reflection proposal
https://bugs.webkit.org/show_bug.cgi?id=158116
Reviewed by Yusuke Suzuki.
JSTests:
* ChakraCore/test/strict/19.function.baseline:
* ChakraCore/test/strict/22.callerCalleeArguments.baseline-jsc:
* microbenchmarks/function-prototype-get.js: Added.
* microbenchmarks/reflect-own-keys-function.js: Added.
* stress/for-in-shadow-non-enumerable.js:
* stress/function-hidden-as-caller.js:
* stress/has-own-property-arguments.js:
* stress/object-assign-fast-path.js:
* stress/put-to-proto-chain-overrides-put.js:
* stress/reflect-set.js:
* test262/config.yaml: Skip 3 test cases that are now incorrect.
* test262/expectations.yaml: Mark 2 test cases as passing.
Source/JavaScriptCore:
To ensure web-compatibility, only the safe subset of Function.prototype.{caller,arguments}
reflection proposal [1] is implemented, which is currently shipped in SpiderMonkey.
Complete list of differences from the proposed spec:
1. Cross-realm receiver function is allowed instead of throwing a TypeError.
Throwing is likely safe to ship, but #225997 needs to be fixed first for
custom properties to receive correct global object.
2. Cross-realm caller function is returned instead of `null`.
Hiding cross-realm caller may break things: we currently have a test for
the opposite behavior.
3. Defines "caller" and "arguments" setters that throw for disallowed receivers,
instead failing silently in sloppy mode.
This is actually more restrictive than the spec, which is preferable,
and aligns with V8 and SM.
Most importantly, this patch removes own "caller" and "arguments" properties from
sloppy mode ES5 functions. They were non-configurable, making it harder to use
their holder as a [[ProxyTarget]]. They were also non-writable, with a constantly
changing [[Value]], which violated the invariants of internal methods [2].
As a result, JSFunction methods are greatly simplified, especially defineOwnProperty()
and getOwnSpecialPropertyNames(). The latter is now 2.1x faster according to the
provided microbenchmark. Also, removes double "prototype" lookup from [[Get]],
which is a 10% progression.
[1]: https://github.com/claudepache/es-legacy-function-reflection
[2]: https://tc39.es/ecma262/#sec-invariants-of-the-essential-internal-methods
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::getOwnPropertySlot):
(JSC::ClonedArguments::materializeSpecials):
* runtime/FunctionExecutable.h:
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::addFunctionProperties):
(JSC::isAllowedReceiverFunctionForCallerAndArguments):
(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor):
(JSC::RetrieveArgumentsFunctor::result const):
(JSC::RetrieveArgumentsFunctor::operator() const):
(JSC::retrieveArguments):
(JSC::JSC_DEFINE_CUSTOM_GETTER):
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor):
(JSC::RetrieveCallerFunctionFunctor::result const):
(JSC::RetrieveCallerFunctionFunctor::operator() const):
(JSC::retrieveCallerFunction):
(JSC::JSC_DEFINE_CUSTOM_SETTER):
(JSC::FunctionPrototype::initRestrictedProperties): Deleted.
* runtime/FunctionPrototype.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnSpecialPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::defineOwnProperty):
(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): Deleted.
(JSC::RetrieveArgumentsFunctor::result const): Deleted.
(JSC::RetrieveArgumentsFunctor::operator() const): Deleted.
(JSC::retrieveArguments): Deleted.
(JSC::JSC_DEFINE_CUSTOM_GETTER): Deleted.
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): Deleted.
(JSC::RetrieveCallerFunctionFunctor::result const): Deleted.
(JSC::RetrieveCallerFunctionFunctor::operator() const): Deleted.
(JSC::retrieveCallerFunction): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* runtime/JSGlobalObject.h:
Remove unused m_throwTypeErrorGetterSetter and make [[ThrowTypeError]] lazily-created.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/JSGlobalObjectFunctions.h:
* runtime/JSObject.cpp:
(JSC::JSObject::putDirectCustomGetterSetterWithoutTransition):
* runtime/JSObject.h:
LayoutTests:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/runtime/getDisplayableProperties-expected.txt:
* inspector/runtime/getProperties-expected.txt:
* js/Object-getOwnPropertyNames-expected.txt:
* js/basic-strict-mode-expected.txt:
* js/kde/function_arguments-expected.txt:
* js/kde/script-tests/function_arguments.js:
* js/non-strict-function-properties-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:
* js/script-tests/basic-strict-mode.js:
* js/script-tests/non-strict-function-properties.js:
* js/script-tests/throw-type-error-is-unique.js:
Canonical link: https://commits.webkit.org/239947@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-25 22:32:20 +00:00
|
|
|
prototype
|
2015-02-17 20:17:28 +00:00
|
|
|
length
|
|
|
|
name
|
|
|
|
__proto__
|
|
|
|
|
2015-02-25 00:31:42 +00:00
|
|
|
DISPLAYABLE PROPERTIES:
|
Partly implement Function.prototype.{caller,arguments} reflection proposal
https://bugs.webkit.org/show_bug.cgi?id=158116
Reviewed by Yusuke Suzuki.
JSTests:
* ChakraCore/test/strict/19.function.baseline:
* ChakraCore/test/strict/22.callerCalleeArguments.baseline-jsc:
* microbenchmarks/function-prototype-get.js: Added.
* microbenchmarks/reflect-own-keys-function.js: Added.
* stress/for-in-shadow-non-enumerable.js:
* stress/function-hidden-as-caller.js:
* stress/has-own-property-arguments.js:
* stress/object-assign-fast-path.js:
* stress/put-to-proto-chain-overrides-put.js:
* stress/reflect-set.js:
* test262/config.yaml: Skip 3 test cases that are now incorrect.
* test262/expectations.yaml: Mark 2 test cases as passing.
Source/JavaScriptCore:
To ensure web-compatibility, only the safe subset of Function.prototype.{caller,arguments}
reflection proposal [1] is implemented, which is currently shipped in SpiderMonkey.
Complete list of differences from the proposed spec:
1. Cross-realm receiver function is allowed instead of throwing a TypeError.
Throwing is likely safe to ship, but #225997 needs to be fixed first for
custom properties to receive correct global object.
2. Cross-realm caller function is returned instead of `null`.
Hiding cross-realm caller may break things: we currently have a test for
the opposite behavior.
3. Defines "caller" and "arguments" setters that throw for disallowed receivers,
instead failing silently in sloppy mode.
This is actually more restrictive than the spec, which is preferable,
and aligns with V8 and SM.
Most importantly, this patch removes own "caller" and "arguments" properties from
sloppy mode ES5 functions. They were non-configurable, making it harder to use
their holder as a [[ProxyTarget]]. They were also non-writable, with a constantly
changing [[Value]], which violated the invariants of internal methods [2].
As a result, JSFunction methods are greatly simplified, especially defineOwnProperty()
and getOwnSpecialPropertyNames(). The latter is now 2.1x faster according to the
provided microbenchmark. Also, removes double "prototype" lookup from [[Get]],
which is a 10% progression.
[1]: https://github.com/claudepache/es-legacy-function-reflection
[2]: https://tc39.es/ecma262/#sec-invariants-of-the-essential-internal-methods
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::getOwnPropertySlot):
(JSC::ClonedArguments::materializeSpecials):
* runtime/FunctionExecutable.h:
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::addFunctionProperties):
(JSC::isAllowedReceiverFunctionForCallerAndArguments):
(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor):
(JSC::RetrieveArgumentsFunctor::result const):
(JSC::RetrieveArgumentsFunctor::operator() const):
(JSC::retrieveArguments):
(JSC::JSC_DEFINE_CUSTOM_GETTER):
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor):
(JSC::RetrieveCallerFunctionFunctor::result const):
(JSC::RetrieveCallerFunctionFunctor::operator() const):
(JSC::retrieveCallerFunction):
(JSC::JSC_DEFINE_CUSTOM_SETTER):
(JSC::FunctionPrototype::initRestrictedProperties): Deleted.
* runtime/FunctionPrototype.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnSpecialPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::defineOwnProperty):
(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): Deleted.
(JSC::RetrieveArgumentsFunctor::result const): Deleted.
(JSC::RetrieveArgumentsFunctor::operator() const): Deleted.
(JSC::retrieveArguments): Deleted.
(JSC::JSC_DEFINE_CUSTOM_GETTER): Deleted.
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): Deleted.
(JSC::RetrieveCallerFunctionFunctor::result const): Deleted.
(JSC::RetrieveCallerFunctionFunctor::operator() const): Deleted.
(JSC::retrieveCallerFunction): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* runtime/JSGlobalObject.h:
Remove unused m_throwTypeErrorGetterSetter and make [[ThrowTypeError]] lazily-created.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/JSGlobalObjectFunctions.h:
* runtime/JSObject.cpp:
(JSC::JSObject::putDirectCustomGetterSetterWithoutTransition):
* runtime/JSObject.h:
LayoutTests:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/runtime/getDisplayableProperties-expected.txt:
* inspector/runtime/getProperties-expected.txt:
* js/Object-getOwnPropertyNames-expected.txt:
* js/basic-strict-mode-expected.txt:
* js/kde/function_arguments-expected.txt:
* js/kde/script-tests/function_arguments.js:
* js/non-strict-function-properties-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:
* js/script-tests/basic-strict-mode.js:
* js/script-tests/non-strict-function-properties.js:
* js/script-tests/throw-type-error-is-unique.js:
Canonical link: https://commits.webkit.org/239947@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-25 22:32:20 +00:00
|
|
|
prototype
|
2015-02-17 20:17:28 +00:00
|
|
|
length
|
|
|
|
name
|
Partly implement Function.prototype.{caller,arguments} reflection proposal
https://bugs.webkit.org/show_bug.cgi?id=158116
Reviewed by Yusuke Suzuki.
JSTests:
* ChakraCore/test/strict/19.function.baseline:
* ChakraCore/test/strict/22.callerCalleeArguments.baseline-jsc:
* microbenchmarks/function-prototype-get.js: Added.
* microbenchmarks/reflect-own-keys-function.js: Added.
* stress/for-in-shadow-non-enumerable.js:
* stress/function-hidden-as-caller.js:
* stress/has-own-property-arguments.js:
* stress/object-assign-fast-path.js:
* stress/put-to-proto-chain-overrides-put.js:
* stress/reflect-set.js:
* test262/config.yaml: Skip 3 test cases that are now incorrect.
* test262/expectations.yaml: Mark 2 test cases as passing.
Source/JavaScriptCore:
To ensure web-compatibility, only the safe subset of Function.prototype.{caller,arguments}
reflection proposal [1] is implemented, which is currently shipped in SpiderMonkey.
Complete list of differences from the proposed spec:
1. Cross-realm receiver function is allowed instead of throwing a TypeError.
Throwing is likely safe to ship, but #225997 needs to be fixed first for
custom properties to receive correct global object.
2. Cross-realm caller function is returned instead of `null`.
Hiding cross-realm caller may break things: we currently have a test for
the opposite behavior.
3. Defines "caller" and "arguments" setters that throw for disallowed receivers,
instead failing silently in sloppy mode.
This is actually more restrictive than the spec, which is preferable,
and aligns with V8 and SM.
Most importantly, this patch removes own "caller" and "arguments" properties from
sloppy mode ES5 functions. They were non-configurable, making it harder to use
their holder as a [[ProxyTarget]]. They were also non-writable, with a constantly
changing [[Value]], which violated the invariants of internal methods [2].
As a result, JSFunction methods are greatly simplified, especially defineOwnProperty()
and getOwnSpecialPropertyNames(). The latter is now 2.1x faster according to the
provided microbenchmark. Also, removes double "prototype" lookup from [[Get]],
which is a 10% progression.
[1]: https://github.com/claudepache/es-legacy-function-reflection
[2]: https://tc39.es/ecma262/#sec-invariants-of-the-essential-internal-methods
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::getOwnPropertySlot):
(JSC::ClonedArguments::materializeSpecials):
* runtime/FunctionExecutable.h:
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::addFunctionProperties):
(JSC::isAllowedReceiverFunctionForCallerAndArguments):
(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor):
(JSC::RetrieveArgumentsFunctor::result const):
(JSC::RetrieveArgumentsFunctor::operator() const):
(JSC::retrieveArguments):
(JSC::JSC_DEFINE_CUSTOM_GETTER):
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor):
(JSC::RetrieveCallerFunctionFunctor::result const):
(JSC::RetrieveCallerFunctionFunctor::operator() const):
(JSC::retrieveCallerFunction):
(JSC::JSC_DEFINE_CUSTOM_SETTER):
(JSC::FunctionPrototype::initRestrictedProperties): Deleted.
* runtime/FunctionPrototype.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnSpecialPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::defineOwnProperty):
(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): Deleted.
(JSC::RetrieveArgumentsFunctor::result const): Deleted.
(JSC::RetrieveArgumentsFunctor::operator() const): Deleted.
(JSC::retrieveArguments): Deleted.
(JSC::JSC_DEFINE_CUSTOM_GETTER): Deleted.
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): Deleted.
(JSC::RetrieveCallerFunctionFunctor::result const): Deleted.
(JSC::RetrieveCallerFunctionFunctor::operator() const): Deleted.
(JSC::retrieveCallerFunction): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* runtime/JSGlobalObject.h:
Remove unused m_throwTypeErrorGetterSetter and make [[ThrowTypeError]] lazily-created.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/JSGlobalObjectFunctions.h:
* runtime/JSObject.cpp:
(JSC::JSObject::putDirectCustomGetterSetterWithoutTransition):
* runtime/JSObject.h:
LayoutTests:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/runtime/getDisplayableProperties-expected.txt:
* inspector/runtime/getProperties-expected.txt:
* js/Object-getOwnPropertyNames-expected.txt:
* js/basic-strict-mode-expected.txt:
* js/kde/function_arguments-expected.txt:
* js/kde/script-tests/function_arguments.js:
* js/non-strict-function-properties-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:
* js/script-tests/basic-strict-mode.js:
* js/script-tests/non-strict-function-properties.js:
* js/script-tests/throw-type-error-is-unique.js:
Canonical link: https://commits.webkit.org/239947@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-25 22:32:20 +00:00
|
|
|
arguments
|
|
|
|
caller
|
2015-02-17 20:17:28 +00:00
|
|
|
__proto__
|
|
|
|
|
|
|
|
ALL PROPERTIES:
|
Partly implement Function.prototype.{caller,arguments} reflection proposal
https://bugs.webkit.org/show_bug.cgi?id=158116
Reviewed by Yusuke Suzuki.
JSTests:
* ChakraCore/test/strict/19.function.baseline:
* ChakraCore/test/strict/22.callerCalleeArguments.baseline-jsc:
* microbenchmarks/function-prototype-get.js: Added.
* microbenchmarks/reflect-own-keys-function.js: Added.
* stress/for-in-shadow-non-enumerable.js:
* stress/function-hidden-as-caller.js:
* stress/has-own-property-arguments.js:
* stress/object-assign-fast-path.js:
* stress/put-to-proto-chain-overrides-put.js:
* stress/reflect-set.js:
* test262/config.yaml: Skip 3 test cases that are now incorrect.
* test262/expectations.yaml: Mark 2 test cases as passing.
Source/JavaScriptCore:
To ensure web-compatibility, only the safe subset of Function.prototype.{caller,arguments}
reflection proposal [1] is implemented, which is currently shipped in SpiderMonkey.
Complete list of differences from the proposed spec:
1. Cross-realm receiver function is allowed instead of throwing a TypeError.
Throwing is likely safe to ship, but #225997 needs to be fixed first for
custom properties to receive correct global object.
2. Cross-realm caller function is returned instead of `null`.
Hiding cross-realm caller may break things: we currently have a test for
the opposite behavior.
3. Defines "caller" and "arguments" setters that throw for disallowed receivers,
instead failing silently in sloppy mode.
This is actually more restrictive than the spec, which is preferable,
and aligns with V8 and SM.
Most importantly, this patch removes own "caller" and "arguments" properties from
sloppy mode ES5 functions. They were non-configurable, making it harder to use
their holder as a [[ProxyTarget]]. They were also non-writable, with a constantly
changing [[Value]], which violated the invariants of internal methods [2].
As a result, JSFunction methods are greatly simplified, especially defineOwnProperty()
and getOwnSpecialPropertyNames(). The latter is now 2.1x faster according to the
provided microbenchmark. Also, removes double "prototype" lookup from [[Get]],
which is a 10% progression.
[1]: https://github.com/claudepache/es-legacy-function-reflection
[2]: https://tc39.es/ecma262/#sec-invariants-of-the-essential-internal-methods
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::getOwnPropertySlot):
(JSC::ClonedArguments::materializeSpecials):
* runtime/FunctionExecutable.h:
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::addFunctionProperties):
(JSC::isAllowedReceiverFunctionForCallerAndArguments):
(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor):
(JSC::RetrieveArgumentsFunctor::result const):
(JSC::RetrieveArgumentsFunctor::operator() const):
(JSC::retrieveArguments):
(JSC::JSC_DEFINE_CUSTOM_GETTER):
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor):
(JSC::RetrieveCallerFunctionFunctor::result const):
(JSC::RetrieveCallerFunctionFunctor::operator() const):
(JSC::retrieveCallerFunction):
(JSC::JSC_DEFINE_CUSTOM_SETTER):
(JSC::FunctionPrototype::initRestrictedProperties): Deleted.
* runtime/FunctionPrototype.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnSpecialPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::defineOwnProperty):
(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): Deleted.
(JSC::RetrieveArgumentsFunctor::result const): Deleted.
(JSC::RetrieveArgumentsFunctor::operator() const): Deleted.
(JSC::retrieveArguments): Deleted.
(JSC::JSC_DEFINE_CUSTOM_GETTER): Deleted.
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): Deleted.
(JSC::RetrieveCallerFunctionFunctor::result const): Deleted.
(JSC::RetrieveCallerFunctionFunctor::operator() const): Deleted.
(JSC::retrieveCallerFunction): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* runtime/JSGlobalObject.h:
Remove unused m_throwTypeErrorGetterSetter and make [[ThrowTypeError]] lazily-created.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/JSGlobalObjectFunctions.h:
* runtime/JSObject.cpp:
(JSC::JSObject::putDirectCustomGetterSetterWithoutTransition):
* runtime/JSObject.h:
LayoutTests:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/runtime/getDisplayableProperties-expected.txt:
* inspector/runtime/getProperties-expected.txt:
* js/Object-getOwnPropertyNames-expected.txt:
* js/basic-strict-mode-expected.txt:
* js/kde/function_arguments-expected.txt:
* js/kde/script-tests/function_arguments.js:
* js/non-strict-function-properties-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:
* js/script-tests/basic-strict-mode.js:
* js/script-tests/non-strict-function-properties.js:
* js/script-tests/throw-type-error-is-unique.js:
Canonical link: https://commits.webkit.org/239947@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-25 22:32:20 +00:00
|
|
|
prototype
|
2015-02-17 20:17:28 +00:00
|
|
|
length
|
|
|
|
name
|
|
|
|
toString
|
|
|
|
apply
|
|
|
|
call
|
|
|
|
bind
|
Partly implement Function.prototype.{caller,arguments} reflection proposal
https://bugs.webkit.org/show_bug.cgi?id=158116
Reviewed by Yusuke Suzuki.
JSTests:
* ChakraCore/test/strict/19.function.baseline:
* ChakraCore/test/strict/22.callerCalleeArguments.baseline-jsc:
* microbenchmarks/function-prototype-get.js: Added.
* microbenchmarks/reflect-own-keys-function.js: Added.
* stress/for-in-shadow-non-enumerable.js:
* stress/function-hidden-as-caller.js:
* stress/has-own-property-arguments.js:
* stress/object-assign-fast-path.js:
* stress/put-to-proto-chain-overrides-put.js:
* stress/reflect-set.js:
* test262/config.yaml: Skip 3 test cases that are now incorrect.
* test262/expectations.yaml: Mark 2 test cases as passing.
Source/JavaScriptCore:
To ensure web-compatibility, only the safe subset of Function.prototype.{caller,arguments}
reflection proposal [1] is implemented, which is currently shipped in SpiderMonkey.
Complete list of differences from the proposed spec:
1. Cross-realm receiver function is allowed instead of throwing a TypeError.
Throwing is likely safe to ship, but #225997 needs to be fixed first for
custom properties to receive correct global object.
2. Cross-realm caller function is returned instead of `null`.
Hiding cross-realm caller may break things: we currently have a test for
the opposite behavior.
3. Defines "caller" and "arguments" setters that throw for disallowed receivers,
instead failing silently in sloppy mode.
This is actually more restrictive than the spec, which is preferable,
and aligns with V8 and SM.
Most importantly, this patch removes own "caller" and "arguments" properties from
sloppy mode ES5 functions. They were non-configurable, making it harder to use
their holder as a [[ProxyTarget]]. They were also non-writable, with a constantly
changing [[Value]], which violated the invariants of internal methods [2].
As a result, JSFunction methods are greatly simplified, especially defineOwnProperty()
and getOwnSpecialPropertyNames(). The latter is now 2.1x faster according to the
provided microbenchmark. Also, removes double "prototype" lookup from [[Get]],
which is a 10% progression.
[1]: https://github.com/claudepache/es-legacy-function-reflection
[2]: https://tc39.es/ecma262/#sec-invariants-of-the-essential-internal-methods
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::getOwnPropertySlot):
(JSC::ClonedArguments::materializeSpecials):
* runtime/FunctionExecutable.h:
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::addFunctionProperties):
(JSC::isAllowedReceiverFunctionForCallerAndArguments):
(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor):
(JSC::RetrieveArgumentsFunctor::result const):
(JSC::RetrieveArgumentsFunctor::operator() const):
(JSC::retrieveArguments):
(JSC::JSC_DEFINE_CUSTOM_GETTER):
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor):
(JSC::RetrieveCallerFunctionFunctor::result const):
(JSC::RetrieveCallerFunctionFunctor::operator() const):
(JSC::retrieveCallerFunction):
(JSC::JSC_DEFINE_CUSTOM_SETTER):
(JSC::FunctionPrototype::initRestrictedProperties): Deleted.
* runtime/FunctionPrototype.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnSpecialPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::defineOwnProperty):
(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): Deleted.
(JSC::RetrieveArgumentsFunctor::result const): Deleted.
(JSC::RetrieveArgumentsFunctor::operator() const): Deleted.
(JSC::retrieveArguments): Deleted.
(JSC::JSC_DEFINE_CUSTOM_GETTER): Deleted.
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): Deleted.
(JSC::RetrieveCallerFunctionFunctor::result const): Deleted.
(JSC::RetrieveCallerFunctionFunctor::operator() const): Deleted.
(JSC::retrieveCallerFunction): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* runtime/JSGlobalObject.h:
Remove unused m_throwTypeErrorGetterSetter and make [[ThrowTypeError]] lazily-created.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/JSGlobalObjectFunctions.h:
* runtime/JSObject.cpp:
(JSC::JSObject::putDirectCustomGetterSetterWithoutTransition):
* runtime/JSObject.h:
LayoutTests:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/runtime/getDisplayableProperties-expected.txt:
* inspector/runtime/getProperties-expected.txt:
* js/Object-getOwnPropertyNames-expected.txt:
* js/basic-strict-mode-expected.txt:
* js/kde/function_arguments-expected.txt:
* js/kde/script-tests/function_arguments.js:
* js/non-strict-function-properties-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:
* js/script-tests/basic-strict-mode.js:
* js/script-tests/non-strict-function-properties.js:
* js/script-tests/throw-type-error-is-unique.js:
Canonical link: https://commits.webkit.org/239947@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-25 22:32:20 +00:00
|
|
|
arguments
|
|
|
|
caller
|
2015-02-17 20:17:28 +00:00
|
|
|
constructor
|
[ES6] Add support for Symbol.hasInstance
https://bugs.webkit.org/show_bug.cgi?id=151839
Reviewed by Saam Barati.
Source/JavaScriptCore:
Fixed version of r193986, r193983, and r193974.
This patch adds support for Symbol.hasInstance, unfortunately in order to prevent
regressions several new bytecodes and DFG IR nodes were necessary. Before, Symbol.hasInstance
when executing an instanceof expression we would emit three bytecodes: overrides_has_instance, get_by_id,
then instanceof. As the spec has changed, we emit a more complicated set of bytecodes in addition to some
new ones. First the role of overrides_has_instance and its corresponding DFG node have changed. Now it returns
a js-boolean indicating whether the RHS of the instanceof expression (from here on called the constructor for simplicity)
needs non-default behavior for resolving the expression. i.e. The constructor has a Symbol.hasInstance that differs from the one on
Function.prototype[Symbol.hasInstance] or is a bound/C-API function. Once we get to the DFG this node is generally eliminated as
we can prove the value of Symbol.hasInstance is a constant. The second new bytecode is instanceof_custom. insntanceof_custom, just
emits a call to slow path code that computes the result.
In the DFG, there is also a new node, CheckTypeInfoFlags, which checks the type info flags are consistent with the ones provided and
OSR exits if the flags are not. Additionally, we attempt to prove that the result of CheckHasValue will be a constant and transform
it into a CheckTypeInfoFlags followed by a JSConstant.
* API/JSCallbackObject.h:
* builtins/FunctionPrototype.js:
(symbolHasInstance):
* bytecode/BytecodeBasicBlock.cpp:
(JSC::isBranch): Deleted.
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* bytecode/ExitKind.cpp:
(JSC::exitKindToString):
* bytecode/ExitKind.h:
* bytecode/PreciseJumpTargets.cpp:
(JSC::getJumpTargetsForBytecodeOffset): Deleted.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitOverridesHasInstance):
(JSC::BytecodeGenerator::emitInstanceOfCustom):
(JSC::BytecodeGenerator::emitCheckHasInstance): Deleted.
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::InstanceOfNode::emitBytecode):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGHeapLocation.cpp:
(WTF::printInternal):
* dfg/DFGHeapLocation.h:
* dfg/DFGNode.h:
(JSC::DFG::Node::hasCellOperand):
(JSC::DFG::Node::hasTypeInfoOperand):
(JSC::DFG::Node::typeInfoOperand):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCheckTypeInfoFlags):
(JSC::DFG::SpeculativeJIT::compileInstanceOfCustom):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
(JSC::FTL::DFG::LowerDFGToLLVM::compileOverridesHasInstance):
(JSC::FTL::DFG::LowerDFGToLLVM::compileCheckTypeInfoFlags):
(JSC::FTL::DFG::LowerDFGToLLVM::compileInstanceOfCustom):
(JSC::FTL::DFG::LowerDFGToLLVM::compileCheckHasInstance): Deleted.
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emit_op_instanceof_custom):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof_custom):
(JSC::JIT::emit_op_check_has_instance): Deleted.
(JSC::JIT::emitSlow_op_check_has_instance): Deleted.
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emit_op_instanceof_custom):
(JSC::JIT::emitSlow_op_instanceof_custom):
(JSC::JIT::emit_op_check_has_instance): Deleted.
(JSC::JIT::emitSlow_op_check_has_instance): Deleted.
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonIdentifiers.h:
* runtime/ExceptionHelpers.cpp:
(JSC::invalidParameterInstanceofSourceAppender):
(JSC::invalidParameterInstanceofNotFunctionSourceAppender):
(JSC::invalidParameterInstanceofhasInstanceValueNotFunctionSourceAppender):
(JSC::createInvalidInstanceofParameterErrorNotFunction):
(JSC::createInvalidInstanceofParameterErrorhasInstanceValueNotFunction):
(JSC::createInvalidInstanceofParameterError): Deleted.
* runtime/ExceptionHelpers.h:
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::addFunctionProperties):
* runtime/FunctionPrototype.h:
* runtime/JSBoundFunction.cpp:
(JSC::isBoundFunction):
(JSC::hasInstanceBoundFunction):
* runtime/JSBoundFunction.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::functionProtoHasInstanceSymbolFunction):
* runtime/JSObject.cpp:
(JSC::JSObject::hasInstance):
(JSC::objectPrivateFuncInstanceOf):
* runtime/JSObject.h:
* runtime/JSTypeInfo.h:
(JSC::TypeInfo::TypeInfo):
(JSC::TypeInfo::overridesHasInstance):
* runtime/WriteBarrier.h:
(JSC::WriteBarrierBase<Unknown>::slot):
* tests/es6.yaml:
* tests/stress/instanceof-custom-hasinstancesymbol.js: Added.
(Constructor):
(value):
(instanceOf):
(body):
* tests/stress/symbol-hasInstance.js: Added.
(Constructor):
(value):
(ObjectClass.Symbol.hasInstance):
(NumberClass.Symbol.hasInstance):
LayoutTests:
Fix tests to reflect the changes to instanceof in ES6.
Added a new regression test for bound functions in instanceof
as the perfomance on bound functions should, to some degree,
reflect the performance on C-API users.
* inspector/model/remote-object-get-properties-expected.txt:
* js/Object-getOwnPropertyNames-expected.txt:
* js/exception-for-nonobject-expected.txt:
* js/exception-instanceof-expected.txt:
* js/instance-of-immediates-expected.txt:
* js/regress/instanceof-bound-expected.txt: Added.
* js/regress/instanceof-bound.html: Added.
* js/regress/script-tests/instanceof-bound.js: Added.
(Constructor):
(test):
* js/script-tests/Object-getOwnPropertyNames.js:
Canonical link: https://commits.webkit.org/170515@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-18 00:37:35 +00:00
|
|
|
Symbol(Symbol.hasInstance)
|
2015-02-17 20:17:28 +00:00
|
|
|
toLocaleString
|
|
|
|
valueOf
|
|
|
|
hasOwnProperty
|
|
|
|
propertyIsEnumerable
|
|
|
|
isPrototypeOf
|
|
|
|
__defineGetter__
|
|
|
|
__defineSetter__
|
|
|
|
__lookupGetter__
|
|
|
|
__lookupSetter__
|
|
|
|
__proto__
|
|
|
|
-----------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------
|
|
|
|
EXPRESSION: window.boundFunction
|
|
|
|
type: function
|
Implement Function.name support for getters/setters and inferring name of function properties.
https://bugs.webkit.org/show_bug.cgi?id=154865
Reviewed by Geoffrey Garen.
Source/JavaScriptCore:
1. toString() no longer uses the value of Function.name as the name of the
function in the returned string, because ...
i. Function.name is supposed to be configurable. Hence, it can be made
writable and can be set to any JSValue, or deleted.
ii. Function.prototype.toString() is supposed to produce a string that can be
eval'ed. Hence, for JS functions, the function name in the produced
string must be a legal function name (and not some arbitrary value set in
Function.name). For example, while a number is a legal value for
Function.name, it is not legal as the function name in the toString()
string.
Instead, we'll always use the original name from the JS source that the
function was parsed from.
2. JSFunction::name() now always return the original name, not the value of
the Function.name property. As a result, it also no longer needs an
ExecState* arg.
If the original name is an empty string, JSFunction::name() will use the
inferred name.
3. For JS functions, the original name can be attained from their
FunctionExecutable object.
For host/native functions (which do not have a FunctionExecutable), we get the
"original" name from its NativeExecutable.
4. The m_hostFunctionStubMap now keys its NativeExecutable pointers using the
original name, in addition to the native function and constructor pointers.
This is needed because we want a different NativeExecutable for functions with
a different name (to satisfy (3) above).
5. Changed JSBoundFunction to store the name of its bound function in its
NativeExecutable. This will later be used to generate the toString() string.
It's Function.name value is eagerly initialized at construction time.
6. Function.name for getters/setters are now prefixed with "get"/"set".
This was done both for the JSBoundSlotBaseFunctions and JS definable get/set
functions.
7. Added InternalFunction::m_originalName so that we can use it to generate the
toString() string. We're storing it as a JSString instead of a WTF::String
only because we want InternalFunction to be continue to be trivially
destructible.
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::functionDetails):
* jit/JITThunks.cpp:
(JSC::JITThunks::finalize):
(JSC::JITThunks::hostFunctionStub):
* jit/JITThunks.h:
* runtime/Executable.h:
* runtime/FunctionPrototype.cpp:
(JSC::functionProtoFuncToString):
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::finishCreation):
(JSC::InternalFunction::visitChildren):
(JSC::InternalFunction::name):
(JSC::InternalFunction::displayName):
* runtime/InternalFunction.h:
* runtime/JSBoundFunction.cpp:
(JSC::JSBoundFunction::create):
(JSC::JSBoundFunction::visitChildren):
(JSC::JSBoundFunction::toStringName): Deleted.
* runtime/JSBoundFunction.h:
(JSC::JSBoundFunction::boundThis):
(JSC::JSBoundFunction::boundArgs):
(JSC::JSBoundFunction::createStructure):
* runtime/JSBoundSlotBaseFunction.cpp:
(JSC::boundSlotBaseFunctionCall):
(JSC::JSBoundSlotBaseFunction::create):
* runtime/JSFunction.cpp:
(JSC::JSFunction::initializeRareData):
(JSC::JSFunction::name):
(JSC::JSFunction::displayName):
(JSC::JSFunction::calculatedDisplayName):
(JSC::JSFunction::reifyName):
* runtime/JSFunction.h:
* tests/es6.yaml:
LayoutTests:
* js/function-toString-vs-name-expected.txt: Added.
* js/function-toString-vs-name.html: Added.
* js/script-tests/function-toString-vs-name.js: Added.
Canonical link: https://commits.webkit.org/173305@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197815 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-09 00:01:09 +00:00
|
|
|
description: function unboundFunction() {
|
2015-02-17 20:17:28 +00:00
|
|
|
[native code]
|
|
|
|
}
|
|
|
|
|
|
|
|
OWN PROPERTIES:
|
|
|
|
length
|
[JSC] Improve our bound function implementation
https://bugs.webkit.org/show_bug.cgi?id=205327
Reviewed by Keith Miller.
JSTests:
* microbenchmarks/function-bind-no-inlining-repeat-call.js: Added.
(assert):
(test):
(test2):
(foo):
(let.start.Date.now):
* stress/bind-args.js: Added.
(shouldBe):
(test):
(test2):
Source/JavaScriptCore:
This patch improves Function#bind, and calling bound function with bound arguments.
1. Rename CallFrameSlot::argumentCount to CallFrameSlot::argumentCountIncludingThis.
2. Do not include name in NativeExecutable for JSBoundFunction. Putting name in NativeExecutable is assuming that function + name pair is almost identical.
This is true in host functions except for JSBoundFunction. JSBoundFunction should hold its name in JSBoundFunction.
3. Cache NativeExecutable for JSBoundFunction in the VM. We use a hash-map in JITThunk for NativeExecutables because we assume that host-function creation cannot be
done by the user program: each executable is pre-defined to exactly one object by the environment, and there is no way to create host-functions repeatedly from
the user-program. The only exception to this is JSBoundFunction so caching it on the VM avoids the hash-map lookup. This is not true for JSBoundFunction.
4. ThunkGenerator should support JSBoundFunction call with bound arguments. It turns out that Speedometer2/React-Redux-TodoMVC is using bound function with
bound arguments. Additionally, it is used. This is really bad: when dispatching an event, we first call this function from C++, entering JS world,
going back to C++ world again, and entering JS world to call bound function again. By using ThunkGenerator, we can eliminate this back and forth by directly
calling the bound JS Executable from the thunk. Previously, bound arguments are stored in JSArray. But it is difficult to access them from thunk since we need to consider
have-a-bad-time case. Instead, we use JSImmutableButterfly to save bound arguments so that JIT thunk can quickly access arguments. To capture arguments as
JSImmutableButterfly in JS world, we introduce op_create_arguments_butterfly, and handle it in all tiers.
5. It turns out that eager materialization of "length" in JSBoundFunction takes long time while it is rarely used. This patch makes length lazily reified for JSBoundFunction.
6. To make Function.prototype.bind faster, we track whether "name" and "length" properties of JSFunction is modified or not. This skips has-own-length-property check, which
makes Function.prototype.bind 11~% faster.
Combining things above, creation of JSBoundFunction is 80~% faster. And calling bound function with bound arguments is 3~x faster.
This improves Speedometer2/React-TodoMVC by ~3%.
* builtins/FunctionPrototype.js:
(bind):
* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateImpl):
* bytecode/AccessCaseSnippetParams.cpp:
(JSC::SlowPathCallGeneratorWithArguments::generateImpl):
* bytecode/BytecodeIntrinsicRegistry.h:
* bytecode/BytecodeList.rb:
* bytecode/BytecodeUseDef.cpp:
(JSC::computeUsesForBytecodeIndexImpl):
(JSC::computeDefsForBytecodeIndexImpl):
* bytecode/VirtualRegister.cpp:
(JSC::VirtualRegister::dump const):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitCreateArgumentsButterfly):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::BytecodeIntrinsicNode::emit_intrinsic_createArgumentsButterfly):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGArgumentsUtilities.cpp:
(JSC::DFG::argumentsInvolveStackSlot):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::flushImpl):
(JSC::DFG::ByteCodeParser::handleVarargsInlining):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::isLiveInBytecode):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::forAllLocalsLiveInBytecode):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileFunction):
* dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::emitStoreCallSiteIndex):
* dfg/DFGNodeType.h:
* dfg/DFGOSRAvailabilityAnalysisPhase.cpp:
(JSC::DFG::LocalOSRAvailabilityCalculator::executeNode):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::emitRestoreArguments):
(JSC::DFG::reifyInlinedCallFrames):
(JSC::DFG::OSRExit::emitRestoreArguments):
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::reifyInlinedCallFrames):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPreciseLocalClobberize.h:
(JSC::DFG::PreciseLocalClobberizeAdaptor::readTop):
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCreateArgumentsButterfly):
(JSC::DFG::SpeculativeJIT::compileGetArgumentCountIncludingThis):
(JSC::DFG::SpeculativeJIT::compileSetArgumentCountIncludingThis):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStackLayoutPhase.cpp:
(JSC::DFG::StackLayoutPhase::run):
* dfg/DFGStoreBarrierInsertionPhase.cpp:
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::lower):
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileCreateArgumentsButterfly):
(JSC::FTL::DFG::LowerDFGToB3::compileGetArgumentCountIncludingThis):
(JSC::FTL::DFG::LowerDFGToB3::compileSetArgumentCountIncludingThis):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileDirectCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileCallEval):
(JSC::FTL::DFG::LowerDFGToB3::getArgumentsLength):
(JSC::FTL::DFG::LowerDFGToB3::callPreflight):
* ftl/FTLSlowPathCall.h:
(JSC::FTL::callOperation):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::callSiteAsRawBits const):
(JSC::CallFrame::unsafeCallSiteAsRawBits const):
(JSC::CallFrame::setCurrentVPC):
* interpreter/CallFrame.h:
(JSC::CallFrame::argumentCountIncludingThis const):
(JSC::CallFrame::setArgumentCountIncludingThis):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::jitAssertArgumentCountSane):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::argumentCount):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::prepareForTailCallSlow):
* jit/CallFrameShuffler.cpp:
(JSC::CallFrameShuffler::dump const):
(JSC::CallFrameShuffler::prepareForTailCall):
(JSC::CallFrameShuffler::prepareAny):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::compileWithoutLinking):
* jit/JITCall.cpp:
(JSC::JIT::compileSetupFrame):
(JSC::JIT::compileOpCall):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileSetupFrame):
(JSC::JIT::compileOpCall):
* jit/JITInlines.h:
(JSC::JIT::updateTopCallFrame):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_argument_count):
(JSC::JIT::emit_op_get_rest_length):
(JSC::JIT::emit_op_get_argument):
* jit/SetupVarargsFrame.cpp:
(JSC::emitSetupVarargsFrameFastCase):
* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::SpecializedThunkJIT):
* jit/ThunkGenerators.cpp:
(JSC::arityFixupGenerator):
(JSC::boundFunctionCallGenerator):
(JSC::boundThisNoArgsFunctionCallGenerator): Deleted.
* jit/ThunkGenerators.h:
* jsc.cpp:
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* llint/WebAssembly.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
* runtime/ExecutableBase.h:
* runtime/FunctionRareData.cpp:
(JSC::FunctionRareData::FunctionRareData):
* runtime/FunctionRareData.h:
* runtime/IntlCollatorPrototype.cpp:
(JSC::IntlCollatorPrototypeGetterCompare):
* runtime/IntlDateTimeFormatPrototype.cpp:
(JSC::IntlDateTimeFormatPrototypeGetterFormat):
* runtime/IntlNumberFormatPrototype.cpp:
(JSC::IntlNumberFormatPrototypeGetterFormat):
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* runtime/JSBoundFunction.cpp:
(JSC::boundThisNoArgsFunctionCall):
(JSC::boundFunctionCall):
(JSC::boundThisNoArgsFunctionConstruct):
(JSC::boundFunctionConstruct):
(JSC::JSBoundFunction::create):
(JSC::JSBoundFunction::JSBoundFunction):
(JSC::JSBoundFunction::boundArgsCopy):
(JSC::JSBoundFunction::visitChildren):
* runtime/JSBoundFunction.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::finishCreation):
(JSC::JSFunction::name):
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnNonIndexPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::defineOwnProperty):
(JSC::JSFunction::reifyLength):
(JSC::JSFunction::reifyLazyPropertyIfNeeded):
(JSC::JSFunction::reifyLazyPropertyForHostOrBuiltinIfNeeded):
(JSC::JSFunction::reifyLazyBoundNameIfNeeded):
* runtime/JSFunction.h:
* runtime/JSFunctionInlines.h:
(JSC::JSFunction::areNameAndLengthOriginal):
* runtime/JSGlobalObject.cpp:
(JSC::makeBoundFunction):
(JSC::hasOwnLengthProperty):
* runtime/JSObject.h:
(JSC::getJSFunction):
(JSC::getCallData): Deleted.
(JSC::getConstructData): Deleted.
* runtime/JSObjectInlines.h:
(JSC::getCallData):
(JSC::getConstructData):
* runtime/VM.cpp:
(JSC::thunkGeneratorForIntrinsic):
(JSC::VM::getBoundFunction):
* runtime/VM.h:
* wasm/js/WasmToJS.cpp:
(JSC::Wasm::wasmToJS):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):
Tools:
Support running slow-microbenchmarks.
* Scripts/run-jsc-benchmarks:
LayoutTests:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/runtime/getDisplayableProperties-expected.txt:
* inspector/runtime/getProperties-expected.txt:
Canonical link: https://commits.webkit.org/218747@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-12-22 03:12:00 +00:00
|
|
|
name
|
2015-02-17 20:17:28 +00:00
|
|
|
__proto__
|
|
|
|
targetFunction
|
|
|
|
boundThis
|
|
|
|
boundArgs
|
|
|
|
|
2015-02-25 00:31:42 +00:00
|
|
|
DISPLAYABLE PROPERTIES:
|
2015-02-17 20:17:28 +00:00
|
|
|
length
|
2016-08-10 21:20:47 +00:00
|
|
|
name
|
2018-01-07 00:15:21 +00:00
|
|
|
arguments
|
Partly implement Function.prototype.{caller,arguments} reflection proposal
https://bugs.webkit.org/show_bug.cgi?id=158116
Reviewed by Yusuke Suzuki.
JSTests:
* ChakraCore/test/strict/19.function.baseline:
* ChakraCore/test/strict/22.callerCalleeArguments.baseline-jsc:
* microbenchmarks/function-prototype-get.js: Added.
* microbenchmarks/reflect-own-keys-function.js: Added.
* stress/for-in-shadow-non-enumerable.js:
* stress/function-hidden-as-caller.js:
* stress/has-own-property-arguments.js:
* stress/object-assign-fast-path.js:
* stress/put-to-proto-chain-overrides-put.js:
* stress/reflect-set.js:
* test262/config.yaml: Skip 3 test cases that are now incorrect.
* test262/expectations.yaml: Mark 2 test cases as passing.
Source/JavaScriptCore:
To ensure web-compatibility, only the safe subset of Function.prototype.{caller,arguments}
reflection proposal [1] is implemented, which is currently shipped in SpiderMonkey.
Complete list of differences from the proposed spec:
1. Cross-realm receiver function is allowed instead of throwing a TypeError.
Throwing is likely safe to ship, but #225997 needs to be fixed first for
custom properties to receive correct global object.
2. Cross-realm caller function is returned instead of `null`.
Hiding cross-realm caller may break things: we currently have a test for
the opposite behavior.
3. Defines "caller" and "arguments" setters that throw for disallowed receivers,
instead failing silently in sloppy mode.
This is actually more restrictive than the spec, which is preferable,
and aligns with V8 and SM.
Most importantly, this patch removes own "caller" and "arguments" properties from
sloppy mode ES5 functions. They were non-configurable, making it harder to use
their holder as a [[ProxyTarget]]. They were also non-writable, with a constantly
changing [[Value]], which violated the invariants of internal methods [2].
As a result, JSFunction methods are greatly simplified, especially defineOwnProperty()
and getOwnSpecialPropertyNames(). The latter is now 2.1x faster according to the
provided microbenchmark. Also, removes double "prototype" lookup from [[Get]],
which is a 10% progression.
[1]: https://github.com/claudepache/es-legacy-function-reflection
[2]: https://tc39.es/ecma262/#sec-invariants-of-the-essential-internal-methods
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::getOwnPropertySlot):
(JSC::ClonedArguments::materializeSpecials):
* runtime/FunctionExecutable.h:
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::addFunctionProperties):
(JSC::isAllowedReceiverFunctionForCallerAndArguments):
(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor):
(JSC::RetrieveArgumentsFunctor::result const):
(JSC::RetrieveArgumentsFunctor::operator() const):
(JSC::retrieveArguments):
(JSC::JSC_DEFINE_CUSTOM_GETTER):
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor):
(JSC::RetrieveCallerFunctionFunctor::result const):
(JSC::RetrieveCallerFunctionFunctor::operator() const):
(JSC::retrieveCallerFunction):
(JSC::JSC_DEFINE_CUSTOM_SETTER):
(JSC::FunctionPrototype::initRestrictedProperties): Deleted.
* runtime/FunctionPrototype.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnSpecialPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::defineOwnProperty):
(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): Deleted.
(JSC::RetrieveArgumentsFunctor::result const): Deleted.
(JSC::RetrieveArgumentsFunctor::operator() const): Deleted.
(JSC::retrieveArguments): Deleted.
(JSC::JSC_DEFINE_CUSTOM_GETTER): Deleted.
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): Deleted.
(JSC::RetrieveCallerFunctionFunctor::result const): Deleted.
(JSC::RetrieveCallerFunctionFunctor::operator() const): Deleted.
(JSC::retrieveCallerFunction): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* runtime/JSGlobalObject.h:
Remove unused m_throwTypeErrorGetterSetter and make [[ThrowTypeError]] lazily-created.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/JSGlobalObjectFunctions.h:
* runtime/JSObject.cpp:
(JSC::JSObject::putDirectCustomGetterSetterWithoutTransition):
* runtime/JSObject.h:
LayoutTests:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/runtime/getDisplayableProperties-expected.txt:
* inspector/runtime/getProperties-expected.txt:
* js/Object-getOwnPropertyNames-expected.txt:
* js/basic-strict-mode-expected.txt:
* js/kde/function_arguments-expected.txt:
* js/kde/script-tests/function_arguments.js:
* js/non-strict-function-properties-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:
* js/script-tests/basic-strict-mode.js:
* js/script-tests/non-strict-function-properties.js:
* js/script-tests/throw-type-error-is-unique.js:
Canonical link: https://commits.webkit.org/239947@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-25 22:32:20 +00:00
|
|
|
caller
|
2015-02-17 20:17:28 +00:00
|
|
|
__proto__
|
|
|
|
targetFunction
|
|
|
|
boundThis
|
|
|
|
boundArgs
|
|
|
|
|
|
|
|
ALL PROPERTIES:
|
|
|
|
length
|
2016-08-10 21:20:47 +00:00
|
|
|
name
|
2015-02-17 20:17:28 +00:00
|
|
|
toString
|
|
|
|
apply
|
|
|
|
call
|
|
|
|
bind
|
2018-01-07 00:15:21 +00:00
|
|
|
arguments
|
Partly implement Function.prototype.{caller,arguments} reflection proposal
https://bugs.webkit.org/show_bug.cgi?id=158116
Reviewed by Yusuke Suzuki.
JSTests:
* ChakraCore/test/strict/19.function.baseline:
* ChakraCore/test/strict/22.callerCalleeArguments.baseline-jsc:
* microbenchmarks/function-prototype-get.js: Added.
* microbenchmarks/reflect-own-keys-function.js: Added.
* stress/for-in-shadow-non-enumerable.js:
* stress/function-hidden-as-caller.js:
* stress/has-own-property-arguments.js:
* stress/object-assign-fast-path.js:
* stress/put-to-proto-chain-overrides-put.js:
* stress/reflect-set.js:
* test262/config.yaml: Skip 3 test cases that are now incorrect.
* test262/expectations.yaml: Mark 2 test cases as passing.
Source/JavaScriptCore:
To ensure web-compatibility, only the safe subset of Function.prototype.{caller,arguments}
reflection proposal [1] is implemented, which is currently shipped in SpiderMonkey.
Complete list of differences from the proposed spec:
1. Cross-realm receiver function is allowed instead of throwing a TypeError.
Throwing is likely safe to ship, but #225997 needs to be fixed first for
custom properties to receive correct global object.
2. Cross-realm caller function is returned instead of `null`.
Hiding cross-realm caller may break things: we currently have a test for
the opposite behavior.
3. Defines "caller" and "arguments" setters that throw for disallowed receivers,
instead failing silently in sloppy mode.
This is actually more restrictive than the spec, which is preferable,
and aligns with V8 and SM.
Most importantly, this patch removes own "caller" and "arguments" properties from
sloppy mode ES5 functions. They were non-configurable, making it harder to use
their holder as a [[ProxyTarget]]. They were also non-writable, with a constantly
changing [[Value]], which violated the invariants of internal methods [2].
As a result, JSFunction methods are greatly simplified, especially defineOwnProperty()
and getOwnSpecialPropertyNames(). The latter is now 2.1x faster according to the
provided microbenchmark. Also, removes double "prototype" lookup from [[Get]],
which is a 10% progression.
[1]: https://github.com/claudepache/es-legacy-function-reflection
[2]: https://tc39.es/ecma262/#sec-invariants-of-the-essential-internal-methods
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::getOwnPropertySlot):
(JSC::ClonedArguments::materializeSpecials):
* runtime/FunctionExecutable.h:
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::addFunctionProperties):
(JSC::isAllowedReceiverFunctionForCallerAndArguments):
(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor):
(JSC::RetrieveArgumentsFunctor::result const):
(JSC::RetrieveArgumentsFunctor::operator() const):
(JSC::retrieveArguments):
(JSC::JSC_DEFINE_CUSTOM_GETTER):
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor):
(JSC::RetrieveCallerFunctionFunctor::result const):
(JSC::RetrieveCallerFunctionFunctor::operator() const):
(JSC::retrieveCallerFunction):
(JSC::JSC_DEFINE_CUSTOM_SETTER):
(JSC::FunctionPrototype::initRestrictedProperties): Deleted.
* runtime/FunctionPrototype.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::getOwnPropertySlot):
(JSC::JSFunction::getOwnSpecialPropertyNames):
(JSC::JSFunction::put):
(JSC::JSFunction::deleteProperty):
(JSC::JSFunction::defineOwnProperty):
(JSC::RetrieveArgumentsFunctor::RetrieveArgumentsFunctor): Deleted.
(JSC::RetrieveArgumentsFunctor::result const): Deleted.
(JSC::RetrieveArgumentsFunctor::operator() const): Deleted.
(JSC::retrieveArguments): Deleted.
(JSC::JSC_DEFINE_CUSTOM_GETTER): Deleted.
(JSC::RetrieveCallerFunctionFunctor::RetrieveCallerFunctionFunctor): Deleted.
(JSC::RetrieveCallerFunctionFunctor::result const): Deleted.
(JSC::RetrieveCallerFunctionFunctor::operator() const): Deleted.
(JSC::retrieveCallerFunction): Deleted.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* runtime/JSGlobalObject.h:
Remove unused m_throwTypeErrorGetterSetter and make [[ThrowTypeError]] lazily-created.
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::JSC_DEFINE_HOST_FUNCTION):
* runtime/JSGlobalObjectFunctions.h:
* runtime/JSObject.cpp:
(JSC::JSObject::putDirectCustomGetterSetterWithoutTransition):
* runtime/JSObject.h:
LayoutTests:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/runtime/getDisplayableProperties-expected.txt:
* inspector/runtime/getProperties-expected.txt:
* js/Object-getOwnPropertyNames-expected.txt:
* js/basic-strict-mode-expected.txt:
* js/kde/function_arguments-expected.txt:
* js/kde/script-tests/function_arguments.js:
* js/non-strict-function-properties-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:
* js/script-tests/basic-strict-mode.js:
* js/script-tests/non-strict-function-properties.js:
* js/script-tests/throw-type-error-is-unique.js:
Canonical link: https://commits.webkit.org/239947@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-07-25 22:32:20 +00:00
|
|
|
caller
|
2015-02-17 20:17:28 +00:00
|
|
|
constructor
|
[ES6] Add support for Symbol.hasInstance
https://bugs.webkit.org/show_bug.cgi?id=151839
Reviewed by Saam Barati.
Source/JavaScriptCore:
Fixed version of r193986, r193983, and r193974.
This patch adds support for Symbol.hasInstance, unfortunately in order to prevent
regressions several new bytecodes and DFG IR nodes were necessary. Before, Symbol.hasInstance
when executing an instanceof expression we would emit three bytecodes: overrides_has_instance, get_by_id,
then instanceof. As the spec has changed, we emit a more complicated set of bytecodes in addition to some
new ones. First the role of overrides_has_instance and its corresponding DFG node have changed. Now it returns
a js-boolean indicating whether the RHS of the instanceof expression (from here on called the constructor for simplicity)
needs non-default behavior for resolving the expression. i.e. The constructor has a Symbol.hasInstance that differs from the one on
Function.prototype[Symbol.hasInstance] or is a bound/C-API function. Once we get to the DFG this node is generally eliminated as
we can prove the value of Symbol.hasInstance is a constant. The second new bytecode is instanceof_custom. insntanceof_custom, just
emits a call to slow path code that computes the result.
In the DFG, there is also a new node, CheckTypeInfoFlags, which checks the type info flags are consistent with the ones provided and
OSR exits if the flags are not. Additionally, we attempt to prove that the result of CheckHasValue will be a constant and transform
it into a CheckTypeInfoFlags followed by a JSConstant.
* API/JSCallbackObject.h:
* builtins/FunctionPrototype.js:
(symbolHasInstance):
* bytecode/BytecodeBasicBlock.cpp:
(JSC::isBranch): Deleted.
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* bytecode/ExitKind.cpp:
(JSC::exitKindToString):
* bytecode/ExitKind.h:
* bytecode/PreciseJumpTargets.cpp:
(JSC::getJumpTargetsForBytecodeOffset): Deleted.
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitOverridesHasInstance):
(JSC::BytecodeGenerator::emitInstanceOfCustom):
(JSC::BytecodeGenerator::emitCheckHasInstance): Deleted.
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::InstanceOfNode::emitBytecode):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGHeapLocation.cpp:
(WTF::printInternal):
* dfg/DFGHeapLocation.h:
* dfg/DFGNode.h:
(JSC::DFG::Node::hasCellOperand):
(JSC::DFG::Node::hasTypeInfoOperand):
(JSC::DFG::Node::typeInfoOperand):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCheckTypeInfoFlags):
(JSC::DFG::SpeculativeJIT::compileInstanceOfCustom):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
(JSC::FTL::DFG::LowerDFGToLLVM::compileOverridesHasInstance):
(JSC::FTL::DFG::LowerDFGToLLVM::compileCheckTypeInfoFlags):
(JSC::FTL::DFG::LowerDFGToLLVM::compileInstanceOfCustom):
(JSC::FTL::DFG::LowerDFGToLLVM::compileCheckHasInstance): Deleted.
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emit_op_instanceof_custom):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof_custom):
(JSC::JIT::emit_op_check_has_instance): Deleted.
(JSC::JIT::emitSlow_op_check_has_instance): Deleted.
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emit_op_instanceof_custom):
(JSC::JIT::emitSlow_op_instanceof_custom):
(JSC::JIT::emit_op_check_has_instance): Deleted.
(JSC::JIT::emitSlow_op_check_has_instance): Deleted.
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonIdentifiers.h:
* runtime/ExceptionHelpers.cpp:
(JSC::invalidParameterInstanceofSourceAppender):
(JSC::invalidParameterInstanceofNotFunctionSourceAppender):
(JSC::invalidParameterInstanceofhasInstanceValueNotFunctionSourceAppender):
(JSC::createInvalidInstanceofParameterErrorNotFunction):
(JSC::createInvalidInstanceofParameterErrorhasInstanceValueNotFunction):
(JSC::createInvalidInstanceofParameterError): Deleted.
* runtime/ExceptionHelpers.h:
* runtime/FunctionPrototype.cpp:
(JSC::FunctionPrototype::addFunctionProperties):
* runtime/FunctionPrototype.h:
* runtime/JSBoundFunction.cpp:
(JSC::isBoundFunction):
(JSC::hasInstanceBoundFunction):
* runtime/JSBoundFunction.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::functionProtoHasInstanceSymbolFunction):
* runtime/JSObject.cpp:
(JSC::JSObject::hasInstance):
(JSC::objectPrivateFuncInstanceOf):
* runtime/JSObject.h:
* runtime/JSTypeInfo.h:
(JSC::TypeInfo::TypeInfo):
(JSC::TypeInfo::overridesHasInstance):
* runtime/WriteBarrier.h:
(JSC::WriteBarrierBase<Unknown>::slot):
* tests/es6.yaml:
* tests/stress/instanceof-custom-hasinstancesymbol.js: Added.
(Constructor):
(value):
(instanceOf):
(body):
* tests/stress/symbol-hasInstance.js: Added.
(Constructor):
(value):
(ObjectClass.Symbol.hasInstance):
(NumberClass.Symbol.hasInstance):
LayoutTests:
Fix tests to reflect the changes to instanceof in ES6.
Added a new regression test for bound functions in instanceof
as the perfomance on bound functions should, to some degree,
reflect the performance on C-API users.
* inspector/model/remote-object-get-properties-expected.txt:
* js/Object-getOwnPropertyNames-expected.txt:
* js/exception-for-nonobject-expected.txt:
* js/exception-instanceof-expected.txt:
* js/instance-of-immediates-expected.txt:
* js/regress/instanceof-bound-expected.txt: Added.
* js/regress/instanceof-bound.html: Added.
* js/regress/script-tests/instanceof-bound.js: Added.
(Constructor):
(test):
* js/script-tests/Object-getOwnPropertyNames.js:
Canonical link: https://commits.webkit.org/170515@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194248 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-18 00:37:35 +00:00
|
|
|
Symbol(Symbol.hasInstance)
|
2015-02-17 20:17:28 +00:00
|
|
|
toLocaleString
|
|
|
|
valueOf
|
|
|
|
hasOwnProperty
|
|
|
|
propertyIsEnumerable
|
|
|
|
isPrototypeOf
|
|
|
|
__defineGetter__
|
|
|
|
__defineSetter__
|
|
|
|
__lookupGetter__
|
|
|
|
__lookupSetter__
|
|
|
|
__proto__
|
|
|
|
targetFunction
|
|
|
|
boundThis
|
|
|
|
boundArgs
|
|
|
|
-----------------------------------------------------
|
2015-04-07 21:28:57 +00:00
|
|
|
|
|
|
|
-----------------------------------------------------
|
|
|
|
EXPRESSION: window.objectWithSymbolProperties
|
|
|
|
type: object
|
|
|
|
description: Object
|
|
|
|
|
|
|
|
OWN PROPERTIES:
|
|
|
|
prop
|
|
|
|
prop2
|
|
|
|
Symbol()
|
|
|
|
Symbol(sym)
|
|
|
|
Symbol(sym)
|
|
|
|
Symbol()
|
Remove className() and toStringName() from the method table
https://bugs.webkit.org/show_bug.cgi?id=224247
Reviewed by Darin Adler.
Source/JavaScriptCore:
ES6 introduced Symbol.toStringTag to customize Object.prototype.toString return value.
It was adopted by WebIDL spec, Chrome's DevTools, Node.js etc. There is no reason to
keep 2 method table methods, each with only 1 call site, instead of using the symbol.
Also, it's a bit confusing that for some objects, method table's className() returns
different result than JSCell::className(VM&).
This change:
1. Removes JSProxy's className() / toStringName() methods because its target() is a
global object that never has these overrides and uses Symbol.toStringTag instead.
2. Removes DebuggerScope's className() / toStringName() overrides because its objectAtScope()
has these methods extremely rarely (e.g. `with (new Date) {}`), and its not displayed
by Web Inspector.
3. Merges JSCallbackObject's className() / toStringName() methods into Symbol.toStringTag
branch of getOwnPropertySlot(), with permissive property attributes. To avoid any possible
breakage, we make sure that it will be shadowed by a structure property.
4. Reworks JSObject::calculatedClassName() to rely on Symbol.toStringTag, matching Chrome's
DevTools behavior. On its own, it's a nice change for Web Inspector. We make sure to
lookup Symbol.toStringTag if `constructor.name` inference fails to avoid confusion when
extending builtins.
5. Removes now unused className() from the method table.
6. Removes toStringName() override from JSFinalizationRegistry because its builtin tag [1]
is already "Object".
7. Introduces BooleanObjectType for Boolean wrapper object, and Boolean.prototype as it's
also required to have a [[BooleanData]] internal slot [2].
8. Reworks Object.prototype.toString to determine builtin tag [1] based on JSType rather than
performing method table call. It's guaranteed that a) the set of types we are checking
against won't be expanded, and b) objects with these types have correct `className`.
9. Removes now unused toStringTag() from the method table.
This patch is performance-neutral and carefully preserves current behavior for API objects,
including isPokerBros() hack.
[1]: https://tc39.es/ecma262/#sec-object.prototype.tostring (steps 5-14)
[2]: https://tc39.es/ecma262/#sec-properties-of-the-boolean-prototype-object
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::JSCallbackObject<Parent>::getOwnPropertySlot):
(JSC::JSCallbackObject<Parent>::className): Deleted.
(JSC::JSCallbackObject<Parent>::toStringName): Deleted.
* API/tests/testapiScripts/testapi.js:
* debugger/DebuggerScope.cpp:
(JSC::DebuggerScope::className): Deleted.
(JSC::DebuggerScope::toStringName): Deleted.
* debugger/DebuggerScope.h:
* runtime/BooleanObject.cpp:
(JSC::BooleanObject::toStringName): Deleted.
* runtime/BooleanObject.h:
(JSC::BooleanObject::createStructure):
* runtime/BooleanPrototype.h:
* runtime/ClassInfo.h:
* runtime/DateInstance.cpp:
(JSC::DateInstance::toStringName): Deleted.
* runtime/DateInstance.h:
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::toStringName): Deleted.
* runtime/ErrorInstance.h:
* runtime/JSCell.cpp:
(JSC::JSCell::className): Deleted.
(JSC::JSCell::toStringName): Deleted.
* runtime/JSCell.h:
* runtime/JSFinalizationRegistry.cpp:
(JSC::JSFinalizationRegistry::toStringName): Deleted.
* runtime/JSFinalizationRegistry.h:
* runtime/JSObject.cpp:
(JSC::JSObject::calculatedClassName):
(JSC::JSObject::className): Deleted.
(JSC::isPokerBros): Deleted.
(JSC::JSObject::toStringName): Deleted.
* runtime/JSObject.h:
* runtime/JSProxy.cpp:
(JSC::JSProxy::className): Deleted.
(JSC::JSProxy::toStringName): Deleted.
* runtime/JSProxy.h:
* runtime/JSType.cpp:
(WTF::printInternal):
* runtime/JSType.h:
* runtime/NumberObject.cpp:
(JSC::NumberObject::toStringName): Deleted.
* runtime/NumberObject.h:
(JSC::NumberObject::createStructure):
* runtime/ObjectPrototype.cpp:
(JSC::isPokerBros):
(JSC::inferBuiltinTag):
(JSC::objectPrototypeToString):
1. Removes jsNontrivialString() because it's assertion may fail in case of iOS hack.
2. Utilizes AtomStringImpl to avoid allocating StringImpl for a small fixed set of strings.
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::toStringName): Deleted.
* runtime/RegExpObject.h:
* runtime/StringObject.cpp:
(JSC::StringObject::toStringName): Deleted.
* runtime/StringObject.h:
LayoutTests:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/model/remote-object-get-properties.html:
Canonical link: https://commits.webkit.org/236359@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-10 01:00:15 +00:00
|
|
|
Symbol(Symbol.toStringTag)
|
2015-04-07 21:28:57 +00:00
|
|
|
__proto__
|
|
|
|
|
|
|
|
DISPLAYABLE PROPERTIES:
|
|
|
|
prop
|
|
|
|
prop2
|
|
|
|
Symbol()
|
|
|
|
Symbol(sym)
|
|
|
|
Symbol(sym)
|
|
|
|
Symbol()
|
Remove className() and toStringName() from the method table
https://bugs.webkit.org/show_bug.cgi?id=224247
Reviewed by Darin Adler.
Source/JavaScriptCore:
ES6 introduced Symbol.toStringTag to customize Object.prototype.toString return value.
It was adopted by WebIDL spec, Chrome's DevTools, Node.js etc. There is no reason to
keep 2 method table methods, each with only 1 call site, instead of using the symbol.
Also, it's a bit confusing that for some objects, method table's className() returns
different result than JSCell::className(VM&).
This change:
1. Removes JSProxy's className() / toStringName() methods because its target() is a
global object that never has these overrides and uses Symbol.toStringTag instead.
2. Removes DebuggerScope's className() / toStringName() overrides because its objectAtScope()
has these methods extremely rarely (e.g. `with (new Date) {}`), and its not displayed
by Web Inspector.
3. Merges JSCallbackObject's className() / toStringName() methods into Symbol.toStringTag
branch of getOwnPropertySlot(), with permissive property attributes. To avoid any possible
breakage, we make sure that it will be shadowed by a structure property.
4. Reworks JSObject::calculatedClassName() to rely on Symbol.toStringTag, matching Chrome's
DevTools behavior. On its own, it's a nice change for Web Inspector. We make sure to
lookup Symbol.toStringTag if `constructor.name` inference fails to avoid confusion when
extending builtins.
5. Removes now unused className() from the method table.
6. Removes toStringName() override from JSFinalizationRegistry because its builtin tag [1]
is already "Object".
7. Introduces BooleanObjectType for Boolean wrapper object, and Boolean.prototype as it's
also required to have a [[BooleanData]] internal slot [2].
8. Reworks Object.prototype.toString to determine builtin tag [1] based on JSType rather than
performing method table call. It's guaranteed that a) the set of types we are checking
against won't be expanded, and b) objects with these types have correct `className`.
9. Removes now unused toStringTag() from the method table.
This patch is performance-neutral and carefully preserves current behavior for API objects,
including isPokerBros() hack.
[1]: https://tc39.es/ecma262/#sec-object.prototype.tostring (steps 5-14)
[2]: https://tc39.es/ecma262/#sec-properties-of-the-boolean-prototype-object
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::JSCallbackObject<Parent>::getOwnPropertySlot):
(JSC::JSCallbackObject<Parent>::className): Deleted.
(JSC::JSCallbackObject<Parent>::toStringName): Deleted.
* API/tests/testapiScripts/testapi.js:
* debugger/DebuggerScope.cpp:
(JSC::DebuggerScope::className): Deleted.
(JSC::DebuggerScope::toStringName): Deleted.
* debugger/DebuggerScope.h:
* runtime/BooleanObject.cpp:
(JSC::BooleanObject::toStringName): Deleted.
* runtime/BooleanObject.h:
(JSC::BooleanObject::createStructure):
* runtime/BooleanPrototype.h:
* runtime/ClassInfo.h:
* runtime/DateInstance.cpp:
(JSC::DateInstance::toStringName): Deleted.
* runtime/DateInstance.h:
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::toStringName): Deleted.
* runtime/ErrorInstance.h:
* runtime/JSCell.cpp:
(JSC::JSCell::className): Deleted.
(JSC::JSCell::toStringName): Deleted.
* runtime/JSCell.h:
* runtime/JSFinalizationRegistry.cpp:
(JSC::JSFinalizationRegistry::toStringName): Deleted.
* runtime/JSFinalizationRegistry.h:
* runtime/JSObject.cpp:
(JSC::JSObject::calculatedClassName):
(JSC::JSObject::className): Deleted.
(JSC::isPokerBros): Deleted.
(JSC::JSObject::toStringName): Deleted.
* runtime/JSObject.h:
* runtime/JSProxy.cpp:
(JSC::JSProxy::className): Deleted.
(JSC::JSProxy::toStringName): Deleted.
* runtime/JSProxy.h:
* runtime/JSType.cpp:
(WTF::printInternal):
* runtime/JSType.h:
* runtime/NumberObject.cpp:
(JSC::NumberObject::toStringName): Deleted.
* runtime/NumberObject.h:
(JSC::NumberObject::createStructure):
* runtime/ObjectPrototype.cpp:
(JSC::isPokerBros):
(JSC::inferBuiltinTag):
(JSC::objectPrototypeToString):
1. Removes jsNontrivialString() because it's assertion may fail in case of iOS hack.
2. Utilizes AtomStringImpl to avoid allocating StringImpl for a small fixed set of strings.
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::toStringName): Deleted.
* runtime/RegExpObject.h:
* runtime/StringObject.cpp:
(JSC::StringObject::toStringName): Deleted.
* runtime/StringObject.h:
LayoutTests:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/model/remote-object-get-properties.html:
Canonical link: https://commits.webkit.org/236359@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-10 01:00:15 +00:00
|
|
|
Symbol(Symbol.toStringTag)
|
2015-04-07 21:28:57 +00:00
|
|
|
__proto__
|
|
|
|
|
|
|
|
ALL PROPERTIES:
|
|
|
|
prop
|
|
|
|
prop2
|
|
|
|
Symbol()
|
|
|
|
Symbol(sym)
|
|
|
|
Symbol(sym)
|
|
|
|
Symbol()
|
Remove className() and toStringName() from the method table
https://bugs.webkit.org/show_bug.cgi?id=224247
Reviewed by Darin Adler.
Source/JavaScriptCore:
ES6 introduced Symbol.toStringTag to customize Object.prototype.toString return value.
It was adopted by WebIDL spec, Chrome's DevTools, Node.js etc. There is no reason to
keep 2 method table methods, each with only 1 call site, instead of using the symbol.
Also, it's a bit confusing that for some objects, method table's className() returns
different result than JSCell::className(VM&).
This change:
1. Removes JSProxy's className() / toStringName() methods because its target() is a
global object that never has these overrides and uses Symbol.toStringTag instead.
2. Removes DebuggerScope's className() / toStringName() overrides because its objectAtScope()
has these methods extremely rarely (e.g. `with (new Date) {}`), and its not displayed
by Web Inspector.
3. Merges JSCallbackObject's className() / toStringName() methods into Symbol.toStringTag
branch of getOwnPropertySlot(), with permissive property attributes. To avoid any possible
breakage, we make sure that it will be shadowed by a structure property.
4. Reworks JSObject::calculatedClassName() to rely on Symbol.toStringTag, matching Chrome's
DevTools behavior. On its own, it's a nice change for Web Inspector. We make sure to
lookup Symbol.toStringTag if `constructor.name` inference fails to avoid confusion when
extending builtins.
5. Removes now unused className() from the method table.
6. Removes toStringName() override from JSFinalizationRegistry because its builtin tag [1]
is already "Object".
7. Introduces BooleanObjectType for Boolean wrapper object, and Boolean.prototype as it's
also required to have a [[BooleanData]] internal slot [2].
8. Reworks Object.prototype.toString to determine builtin tag [1] based on JSType rather than
performing method table call. It's guaranteed that a) the set of types we are checking
against won't be expanded, and b) objects with these types have correct `className`.
9. Removes now unused toStringTag() from the method table.
This patch is performance-neutral and carefully preserves current behavior for API objects,
including isPokerBros() hack.
[1]: https://tc39.es/ecma262/#sec-object.prototype.tostring (steps 5-14)
[2]: https://tc39.es/ecma262/#sec-properties-of-the-boolean-prototype-object
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::JSCallbackObject<Parent>::getOwnPropertySlot):
(JSC::JSCallbackObject<Parent>::className): Deleted.
(JSC::JSCallbackObject<Parent>::toStringName): Deleted.
* API/tests/testapiScripts/testapi.js:
* debugger/DebuggerScope.cpp:
(JSC::DebuggerScope::className): Deleted.
(JSC::DebuggerScope::toStringName): Deleted.
* debugger/DebuggerScope.h:
* runtime/BooleanObject.cpp:
(JSC::BooleanObject::toStringName): Deleted.
* runtime/BooleanObject.h:
(JSC::BooleanObject::createStructure):
* runtime/BooleanPrototype.h:
* runtime/ClassInfo.h:
* runtime/DateInstance.cpp:
(JSC::DateInstance::toStringName): Deleted.
* runtime/DateInstance.h:
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::toStringName): Deleted.
* runtime/ErrorInstance.h:
* runtime/JSCell.cpp:
(JSC::JSCell::className): Deleted.
(JSC::JSCell::toStringName): Deleted.
* runtime/JSCell.h:
* runtime/JSFinalizationRegistry.cpp:
(JSC::JSFinalizationRegistry::toStringName): Deleted.
* runtime/JSFinalizationRegistry.h:
* runtime/JSObject.cpp:
(JSC::JSObject::calculatedClassName):
(JSC::JSObject::className): Deleted.
(JSC::isPokerBros): Deleted.
(JSC::JSObject::toStringName): Deleted.
* runtime/JSObject.h:
* runtime/JSProxy.cpp:
(JSC::JSProxy::className): Deleted.
(JSC::JSProxy::toStringName): Deleted.
* runtime/JSProxy.h:
* runtime/JSType.cpp:
(WTF::printInternal):
* runtime/JSType.h:
* runtime/NumberObject.cpp:
(JSC::NumberObject::toStringName): Deleted.
* runtime/NumberObject.h:
(JSC::NumberObject::createStructure):
* runtime/ObjectPrototype.cpp:
(JSC::isPokerBros):
(JSC::inferBuiltinTag):
(JSC::objectPrototypeToString):
1. Removes jsNontrivialString() because it's assertion may fail in case of iOS hack.
2. Utilizes AtomStringImpl to avoid allocating StringImpl for a small fixed set of strings.
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::toStringName): Deleted.
* runtime/RegExpObject.h:
* runtime/StringObject.cpp:
(JSC::StringObject::toStringName): Deleted.
* runtime/StringObject.h:
LayoutTests:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/model/remote-object-get-properties.html:
Canonical link: https://commits.webkit.org/236359@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-10 01:00:15 +00:00
|
|
|
Symbol(Symbol.toStringTag)
|
2015-04-07 21:28:57 +00:00
|
|
|
toString
|
|
|
|
toLocaleString
|
|
|
|
valueOf
|
|
|
|
hasOwnProperty
|
|
|
|
propertyIsEnumerable
|
|
|
|
isPrototypeOf
|
|
|
|
__defineGetter__
|
|
|
|
__defineSetter__
|
|
|
|
__lookupGetter__
|
|
|
|
__lookupSetter__
|
|
|
|
constructor
|
|
|
|
__proto__
|
|
|
|
-----------------------------------------------------
|
2016-06-28 15:33:49 +00:00
|
|
|
|
Remove className() and toStringName() from the method table
https://bugs.webkit.org/show_bug.cgi?id=224247
Reviewed by Darin Adler.
Source/JavaScriptCore:
ES6 introduced Symbol.toStringTag to customize Object.prototype.toString return value.
It was adopted by WebIDL spec, Chrome's DevTools, Node.js etc. There is no reason to
keep 2 method table methods, each with only 1 call site, instead of using the symbol.
Also, it's a bit confusing that for some objects, method table's className() returns
different result than JSCell::className(VM&).
This change:
1. Removes JSProxy's className() / toStringName() methods because its target() is a
global object that never has these overrides and uses Symbol.toStringTag instead.
2. Removes DebuggerScope's className() / toStringName() overrides because its objectAtScope()
has these methods extremely rarely (e.g. `with (new Date) {}`), and its not displayed
by Web Inspector.
3. Merges JSCallbackObject's className() / toStringName() methods into Symbol.toStringTag
branch of getOwnPropertySlot(), with permissive property attributes. To avoid any possible
breakage, we make sure that it will be shadowed by a structure property.
4. Reworks JSObject::calculatedClassName() to rely on Symbol.toStringTag, matching Chrome's
DevTools behavior. On its own, it's a nice change for Web Inspector. We make sure to
lookup Symbol.toStringTag if `constructor.name` inference fails to avoid confusion when
extending builtins.
5. Removes now unused className() from the method table.
6. Removes toStringName() override from JSFinalizationRegistry because its builtin tag [1]
is already "Object".
7. Introduces BooleanObjectType for Boolean wrapper object, and Boolean.prototype as it's
also required to have a [[BooleanData]] internal slot [2].
8. Reworks Object.prototype.toString to determine builtin tag [1] based on JSType rather than
performing method table call. It's guaranteed that a) the set of types we are checking
against won't be expanded, and b) objects with these types have correct `className`.
9. Removes now unused toStringTag() from the method table.
This patch is performance-neutral and carefully preserves current behavior for API objects,
including isPokerBros() hack.
[1]: https://tc39.es/ecma262/#sec-object.prototype.tostring (steps 5-14)
[2]: https://tc39.es/ecma262/#sec-properties-of-the-boolean-prototype-object
* API/JSCallbackObject.h:
* API/JSCallbackObjectFunctions.h:
(JSC::JSCallbackObject<Parent>::getOwnPropertySlot):
(JSC::JSCallbackObject<Parent>::className): Deleted.
(JSC::JSCallbackObject<Parent>::toStringName): Deleted.
* API/tests/testapiScripts/testapi.js:
* debugger/DebuggerScope.cpp:
(JSC::DebuggerScope::className): Deleted.
(JSC::DebuggerScope::toStringName): Deleted.
* debugger/DebuggerScope.h:
* runtime/BooleanObject.cpp:
(JSC::BooleanObject::toStringName): Deleted.
* runtime/BooleanObject.h:
(JSC::BooleanObject::createStructure):
* runtime/BooleanPrototype.h:
* runtime/ClassInfo.h:
* runtime/DateInstance.cpp:
(JSC::DateInstance::toStringName): Deleted.
* runtime/DateInstance.h:
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::toStringName): Deleted.
* runtime/ErrorInstance.h:
* runtime/JSCell.cpp:
(JSC::JSCell::className): Deleted.
(JSC::JSCell::toStringName): Deleted.
* runtime/JSCell.h:
* runtime/JSFinalizationRegistry.cpp:
(JSC::JSFinalizationRegistry::toStringName): Deleted.
* runtime/JSFinalizationRegistry.h:
* runtime/JSObject.cpp:
(JSC::JSObject::calculatedClassName):
(JSC::JSObject::className): Deleted.
(JSC::isPokerBros): Deleted.
(JSC::JSObject::toStringName): Deleted.
* runtime/JSObject.h:
* runtime/JSProxy.cpp:
(JSC::JSProxy::className): Deleted.
(JSC::JSProxy::toStringName): Deleted.
* runtime/JSProxy.h:
* runtime/JSType.cpp:
(WTF::printInternal):
* runtime/JSType.h:
* runtime/NumberObject.cpp:
(JSC::NumberObject::toStringName): Deleted.
* runtime/NumberObject.h:
(JSC::NumberObject::createStructure):
* runtime/ObjectPrototype.cpp:
(JSC::isPokerBros):
(JSC::inferBuiltinTag):
(JSC::objectPrototypeToString):
1. Removes jsNontrivialString() because it's assertion may fail in case of iOS hack.
2. Utilizes AtomStringImpl to avoid allocating StringImpl for a small fixed set of strings.
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::toStringName): Deleted.
* runtime/RegExpObject.h:
* runtime/StringObject.cpp:
(JSC::StringObject::toStringName): Deleted.
* runtime/StringObject.h:
LayoutTests:
* inspector/model/remote-object-get-properties-expected.txt:
* inspector/model/remote-object-get-properties.html:
Canonical link: https://commits.webkit.org/236359@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275788 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-10 01:00:15 +00:00
|
|
|
-----------------------------------------------------
|
|
|
|
EXPRESSION: window.objectWithSymbolToStringTag
|
|
|
|
type: object
|
|
|
|
description: Foo
|
|
|
|
|
|
|
|
OWN PROPERTIES:
|
|
|
|
Symbol(Symbol.toStringTag)
|
|
|
|
__proto__
|
|
|
|
|
|
|
|
DISPLAYABLE PROPERTIES:
|
|
|
|
Symbol(Symbol.toStringTag)
|
|
|
|
__proto__
|
|
|
|
|
|
|
|
ALL PROPERTIES:
|
|
|
|
Symbol(Symbol.toStringTag)
|
|
|
|
toString
|
|
|
|
toLocaleString
|
|
|
|
valueOf
|
|
|
|
hasOwnProperty
|
|
|
|
propertyIsEnumerable
|
|
|
|
isPrototypeOf
|
|
|
|
__defineGetter__
|
|
|
|
__defineSetter__
|
|
|
|
__lookupGetter__
|
|
|
|
__lookupSetter__
|
|
|
|
constructor
|
|
|
|
__proto__
|
|
|
|
-----------------------------------------------------
|
|
|
|
|
|
|
|
-----------------------------------------------------
|
|
|
|
EXPRESSION: window.objectWithShadowedSymbolToStringTag
|
|
|
|
type: object
|
|
|
|
description: Foo
|
|
|
|
|
|
|
|
OWN PROPERTIES:
|
|
|
|
__proto__
|
|
|
|
|
|
|
|
DISPLAYABLE PROPERTIES:
|
|
|
|
__proto__
|
|
|
|
|
|
|
|
ALL PROPERTIES:
|
|
|
|
constructor
|
|
|
|
addEventListener
|
|
|
|
removeEventListener
|
|
|
|
dispatchEvent
|
|
|
|
Symbol(Symbol.toStringTag)
|
|
|
|
toString
|
|
|
|
toLocaleString
|
|
|
|
valueOf
|
|
|
|
hasOwnProperty
|
|
|
|
propertyIsEnumerable
|
|
|
|
isPrototypeOf
|
|
|
|
__defineGetter__
|
|
|
|
__defineSetter__
|
|
|
|
__lookupGetter__
|
|
|
|
__lookupSetter__
|
|
|
|
__proto__
|
|
|
|
-----------------------------------------------------
|
|
|
|
|
2016-06-28 15:33:49 +00:00
|
|
|
-----------------------------------------------------
|
|
|
|
EXPRESSION: document.getElementById('my-select').options
|
|
|
|
type: object
|
|
|
|
subtype: array
|
|
|
|
description: HTMLOptionsCollection
|
|
|
|
|
|
|
|
OWN PROPERTIES:
|
|
|
|
0
|
|
|
|
__proto__
|
|
|
|
|
|
|
|
DISPLAYABLE PROPERTIES:
|
|
|
|
0
|
|
|
|
length
|
2017-01-15 20:05:20 +00:00
|
|
|
selectedIndex
|
2016-06-28 15:33:49 +00:00
|
|
|
__proto__
|
|
|
|
|
|
|
|
ALL PROPERTIES:
|
|
|
|
0
|
|
|
|
constructor
|
|
|
|
length
|
2017-01-15 20:05:20 +00:00
|
|
|
selectedIndex
|
2016-06-28 15:33:49 +00:00
|
|
|
add
|
|
|
|
remove
|
2017-01-15 20:05:20 +00:00
|
|
|
item
|
|
|
|
namedItem
|
JavaScript for-of does not work on a lot of collection types (e.g. HTMLCollection)
https://bugs.webkit.org/show_bug.cgi?id=167091
Reviewed by Darin Adler.
Source/JavaScriptCore:
Update Array methods to throw a TypeError when (this === null || this === undefined)
instead of when (this == null). This is because (this == null) returns true for types
that masquerades as undefined (such as document.all) and this prevented use of the
Array API on such types. The specification only stays to use ToObject(), which throws
when the input is undefined or null.
The corresponding specification is at:
- https://www.ecma-international.org/ecma-262/7.0/index.html#sec-array.prototype.values
- https://www.ecma-international.org/ecma-262/7.0/index.html#sec-toobject
* builtins/ArrayPrototype.js:
(values):
(keys):
(entries):
(reduce):
(reduceRight):
(every):
(forEach):
(filter):
(map):
(some):
(fill):
(find):
(findIndex):
(includes):
(sort):
(concatSlowPath):
(copyWithin):
Source/WebCore:
As per the Web IDL specification [1], https://heycam.github.io/webidl/#es-iterator
an interface should get an iterator if it has:
- an indexed property getter and an integer-typed attribute named "length".
We now comply with this part of the Web IDL specification. This adds an iterator
to the following interfaces:
- AudioTrackList, ClientRectList, CSSRuleList, CSSStyleDeclaration, CSSValueList,
MimeTypeArray, WebKitNamedFlowCollection, Plugin, PluginArray, DOMStringList,
FileList, HTMLAllCollection, HTMLCollection, HTMLFormElement, HTMLOptionsCollection,
HTMLSelectElement, MediaList, NamedNodeMap, SourceBufferList, StyleSheetList,
TextTrackCueList, TextTrackList, TouchList, VideoTrackList, VTTRegionList.
As a result, it is now possible to use `for ... of` for those types.
Tests: fast/dom/FileList-iterator.html
fast/dom/collection-iterators.html
fast/dom/document-all-undefined.html
fast/events/touch/ios/touchlist-iterator.html
* bindings/scripts/CodeGeneratorJS.pm:
(GetAttributeWithName):
(InterfaceNeedsIterator):
(GenerateImplementation):
(addIterableProperties):
LayoutTests:
* fast/dom/FileList-iterator-expected.txt: Added.
* fast/dom/FileList-iterator.html: Added.
* fast/dom/collection-iterators-expected.txt: Added.
* fast/dom/collection-iterators.html: Added.
* fast/events/touch/ios/touchlist-iterator-expected.txt: Added.
* fast/events/touch/ios/touchlist-iterator.html: Added.
Add layout test coverage for all types that gained an iterator.
* fast/dom/document-all-undefined-expected.txt: Added.
* fast/dom/document-all-undefined.html: Added.
Add layout test to cover the fact that HTMLAllCollection masquerades as
undefined, as per:
- https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-all
* inspector/model/remote-object-get-properties-expected.txt:
Rebaseline now that there is an extra Symbol.iterator property.
* platform/wk2/TestExpectations:
Skip that requires beginDragWithFiles() as this is unimplemented in
WebKitTestRunner.
Canonical link: https://commits.webkit.org/184338@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-01-22 05:48:28 +00:00
|
|
|
Symbol(Symbol.iterator)
|
2020-05-01 09:48:33 +00:00
|
|
|
Symbol(Symbol.toStringTag)
|
2016-06-28 15:33:49 +00:00
|
|
|
toString
|
|
|
|
toLocaleString
|
|
|
|
valueOf
|
|
|
|
hasOwnProperty
|
|
|
|
propertyIsEnumerable
|
|
|
|
isPrototypeOf
|
|
|
|
__defineGetter__
|
|
|
|
__defineSetter__
|
|
|
|
__lookupGetter__
|
|
|
|
__lookupSetter__
|
|
|
|
__proto__
|
|
|
|
-----------------------------------------------------
|
2015-01-21 00:34:57 +00:00
|
|
|
DONE
|
|
|
|
|