Bug 163426

Summary: Exception message for expressions with multiple bracket accesses is inconsistent / incorrect
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: JavaScriptCoreAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, joepeck, keith_miller, mark.lam, msaboff, rniwa, saam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
[PATCH] Proposed Fix
ggaren: review+, buildbot: commit-queue-
Archive of layout-test-results from ews101 for mac-yosemite
none
Archive of layout-test-results from ews107 for mac-yosemite-wk2
none
Archive of layout-test-results from ews117 for mac-yosemite
none
[PATCH] For Landing
none
[PATCH] For Landing none

Description Joseph Pecoraro 2016-10-13 18:18:20 PDT
Summary:
Exception message for expressions with multiple bracket accesses is inconsistent / incorrect

Test:
js> var foo = {};
undefined
js> foo.bar.baz
Exception: TypeError: undefined is not an object (evaluating 'foo.bar.baz')
js> foo["bar"]["baz"]
Exception: TypeError: undefined is not an object (evaluating 'foo["bar"]')

I would expect the bracket access one to say: (evaluating 'foo["bar"]["baz"]').

Notes:
- The same expression info used for the error message is useful in Web Inspector. if baz is a getter in `foo["bar"]["baz"]` then we can go up to the parent call frame and we want to know exactly where in this expression we are, and it is currently off in the same way these error messages are off.
- Dumping the expression range data for this program I see data for unexpected op codes (op_resolve, op_get_by_id, op_end). I'd expect data for (op_resolve, op_get_by_id, op_get_by_id).
Comment 1 Joseph Pecoraro 2016-10-13 18:25:36 PDT
Created attachment 291553 [details]
[PATCH] Proposed Fix
Comment 2 Build Bot 2016-10-13 19:22:09 PDT
Comment on attachment 291553 [details]
[PATCH] Proposed Fix

Attachment 291553 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/2281155

New failing tests:
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/startTime.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/pauseOnExit.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/id.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/track.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/endTime.html
Comment 3 Build Bot 2016-10-13 19:22:12 PDT
Created attachment 291557 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 4 Build Bot 2016-10-13 19:26:15 PDT
Comment on attachment 291553 [details]
[PATCH] Proposed Fix

Attachment 291553 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/2281160

New failing tests:
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/startTime.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/pauseOnExit.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/id.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/track.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/endTime.html
Comment 5 Build Bot 2016-10-13 19:26:18 PDT
Created attachment 291558 [details]
Archive of layout-test-results from ews107 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 6 Build Bot 2016-10-13 19:31:48 PDT
Comment on attachment 291553 [details]
[PATCH] Proposed Fix

Attachment 291553 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/2281162

New failing tests:
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/startTime.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/pauseOnExit.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/id.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/track.html
imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/endTime.html
Comment 7 Build Bot 2016-10-13 19:31:51 PDT
Created attachment 291559 [details]
Archive of layout-test-results from ews117 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews117  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 8 Joseph Pecoraro 2016-10-13 20:01:47 PDT
(In reply to comment #6)
> Comment on attachment 291553 [details]
> [PATCH] Proposed Fix
> 
> Attachment 291553 [details] did not pass mac-debug-ews (mac):
> Output: http://webkit-queues.webkit.org/results/2281162
> 
> New failing tests:
> imported/w3c/web-platform-tests/html/semantics/embedded-content/media-
> elements/interfaces/TextTrackCue/startTime.html
> imported/w3c/web-platform-tests/html/semantics/embedded-content/media-
> elements/interfaces/TextTrackCue/pauseOnExit.html
> imported/w3c/web-platform-tests/html/semantics/embedded-content/media-
> elements/interfaces/TextTrackCue/id.html
> imported/w3c/web-platform-tests/html/semantics/embedded-content/media-
> elements/interfaces/TextTrackCue/track.html
> imported/w3c/web-platform-tests/html/semantics/embedded-content/media-
> elements/interfaces/TextTrackCue/endTime.html

These look like real progressions! We should have specific tests for similar cases! I'll add new tests and put up another patch.
Comment 9 Joseph Pecoraro 2016-10-13 20:21:15 PDT
Created attachment 291560 [details]
[PATCH] For Landing
Comment 10 Joseph Pecoraro 2016-10-13 20:24:00 PDT
*** Bug 160992 has been marked as a duplicate of this bug. ***
Comment 11 Joseph Pecoraro 2016-10-13 21:21:01 PDT
More progressions in JSTests that I need to address:
JSTests/stress/exception-in-to-property-key-should-be-handled-early.js
Comment 12 Joseph Pecoraro 2016-10-13 21:40:47 PDT
Created attachment 291564 [details]
[PATCH] For Landing

Rebaselined with better exception messages:
JSTests/ChakraCore/test/Error/CallNonFunction_3.baseline-jsc:
JSTests/ChakraCore/test/Object/null.baseline-jsc:
JSTests/stress/exception-in-to-property-key-should-be-handled-early.js:

I'll let the bots run through this and then cq it.
Comment 13 WebKit Commit Bot 2016-10-13 23:34:18 PDT
Comment on attachment 291564 [details]
[PATCH] For Landing

Clearing flags on attachment: 291564

Committed r207326: <http://trac.webkit.org/changeset/207326>