Bug 158544 - DedicatedWorkerGlobalScope prototype chain is incorrect
Summary: DedicatedWorkerGlobalScope prototype chain is incorrect
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: WebExposed
Depends on:
Blocks:
 
Reported: 2016-06-08 15:00 PDT by Chris Dumez
Modified: 2016-06-08 22:17 PDT (History)
5 users (show)

See Also:


Attachments
WIP Patch (4.80 KB, patch)
2016-06-08 16:57 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (11.41 KB, patch)
2016-06-08 20:53 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-06-08 15:00:06 PDT
WorkerGlobalScope.prototype is [object DedicatedWorkerGlobalScopePrototype] but should be [object WorkerGlobalScopePrototype]. This is causing failures on:
http://w3c-test.org/workers/interfaces.worker
Comment 1 Chris Dumez 2016-06-08 15:04:26 PDT
Seems related to this in the bindings generator:
   if (IsDOMGlobalObject($interface)) {
        push(@$outputArray, "    putDirect(vm, vm.propertyNames->prototype, globalObject.getPrototypeDirect(), DontDelete | ReadOnly | DontEnum);\n");

IsDOMGlobalObject() returns true for both WorkerGlobalScope and DedicatedWorkerGlobalScope.
Comment 2 Chris Dumez 2016-06-08 16:57:09 PDT
Created attachment 280856 [details]
WIP Patch
Comment 3 Chris Dumez 2016-06-08 18:23:29 PDT
Expected:
DedicatedWorkerGlobalScope.prototype.toString() === "[object DedicatedWorkerGlobalScopePrototype]": true
Object.getPrototypeOf(DedicatedWorkerGlobalScope.prototype) === WorkerGlobalScope.prototype: true
WorkerGlobalScope.prototype.toString() === "[object WorkerGlobalScopePrototype]": true
Object.getPrototypeOf(WorkerGlobalScope.prototype) === EventTarget.prototype: true

But got:
DedicatedWorkerGlobalScope.prototype.toString() === "[object DedicatedWorkerGlobalScopePrototype]": true
Object.getPrototypeOf(DedicatedWorkerGlobalScope.prototype) === WorkerGlobalScope.prototype: false
WorkerGlobalScope.prototype.toString() === "[object WorkerGlobalScopePrototype]": false
Object.getPrototypeOf(WorkerGlobalScope.prototype) === EventTarget.prototype: false
Comment 4 Chris Dumez 2016-06-08 20:53:01 PDT
Created attachment 280879 [details]
Patch
Comment 5 WebKit Commit Bot 2016-06-08 22:17:09 PDT
Comment on attachment 280879 [details]
Patch

Clearing flags on attachment: 280879

Committed r201852: <http://trac.webkit.org/changeset/201852>
Comment 6 WebKit Commit Bot 2016-06-08 22:17:14 PDT
All reviewed patches have been landed.  Closing bug.