Bug 126032

Summary: Revise WebGL DataView test to match ECMAScript Draft Specification
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: Tools / TestsAssignee: Brent Fulgham <bfulgham>
Status: RESOLVED WONTFIX    
Severity: Normal CC: bfulgham, commit-queue, dino, fpizlo, oliver
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 126475    
Bug Blocks:    
Attachments:
Description Flags
Patch dino: review+

Description Brent Fulgham 2013-12-19 17:03:45 PST
Although the original WebGL specification declared the following syntax illegal:

    // Use try/catch instead of calling shouldThrow to avoid different exception message being reported from different platform.
    try {
        expr = DataView(new ArrayBuffer);
        TestEval(expr);
        testFailed(expr + " does not throw exception");
    } catch (e) {
        testPassed(expr + " threw exception");
    }

... this was later superseded by the language in the ECMAScript 6 Draft Specification, which allows DataView to be used as a function returning a constructed DataView object (see http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts for the current draft).

See http://people.mozilla.org/~jorendorff/es6-draft.html#sec-dataview-constructor for an HTML version of the document.
Comment 1 Brent Fulgham 2013-12-19 17:06:14 PST
Specific language:

"The DataView constructor is the %DataView% intrinsic object and the initial value of the DataView property of the global object. When DataView is called as a function rather than as a constructor, it initialises its this value with the internal state necessary to support the DataView.prototype internal methods."
Comment 2 Brent Fulgham 2013-12-19 17:11:06 PST
Created attachment 219708 [details]
Patch
Comment 3 Brent Fulgham 2013-12-19 17:18:34 PST
<rdar://problem/15201835>
Comment 4 Dean Jackson 2014-01-03 11:03:48 PST
Comment on attachment 219708 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=219708&action=review

> LayoutTests/ChangeLog:6
> +        Revise WebGL DataView test to match ECMAScript Draft Specification
> +        https://bugs.webkit.org/show_bug.cgi?id=126032
> +
> +        Reviewed by NOBODY (OOPS!).

Could you note here that we believe this is a bug in the test, and we'll try to get it fixed upstream?
Comment 5 Brent Fulgham 2014-01-03 11:43:43 PST
(In reply to comment #4)
> (From update of attachment 219708 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=219708&action=review
> 
> > LayoutTests/ChangeLog:6
> > +        Revise WebGL DataView test to match ECMAScript Draft Specification
> > +        https://bugs.webkit.org/show_bug.cgi?id=126032
> > +
> > +        Reviewed by NOBODY (OOPS!).
> 
> Could you note here that we believe this is a bug in the test, and we'll try to get it fixed upstream?

Done!
Comment 6 Brent Fulgham 2014-01-03 11:43:51 PST
Committed r161274: <http://trac.webkit.org/changeset/161274>
Comment 7 Dean Jackson 2014-01-03 16:06:07 PST
After more discussion with EMCA folk, it looks like this was an incorrect change.
Comment 8 WebKit Commit Bot 2014-01-03 17:12:57 PST
Re-opened since this is blocked by bug 126475
Comment 9 Brent Fulgham 2014-01-10 08:54:50 PST
After further review, this change is incorrect. We need to modify the behavior of DataView.