Re: [heycam/webidl] Should probably spec a hasInstance for DOM interface objects (#129)

Just happened to be reviewing some WebIDL tests and found a strange inconsistency. Not sure what behavior is desired (in case 3)...

In Firefox 46:
```js
// "w" is a cross-realm windowproxy
test(function() {
  assert_true(document.implementation instanceof w.DOMImplementation);
}, "a DOMImplementation object is considered to be instanceof anotherWindow.DOMImplementation");
// This passes
```

This also passes (because of `OrdinaryHasInstance`?):
```js
test(function() {
  var object = Object.create(document.implementation);
  assert_true(object instanceof DOMImplementation);
}, "an object whose [[Prototype]] is DOMImplementation.prototype is considered to be instanceof window.DOMImplementation");
```

However--and this is the oddity--the following fails:
```js
test(function() {
  var object = Object.create(document.implementation);
  assert_true(object instanceof w.DOMImplementation);
}, "an object whose [[Prototype]] is DOMImplementation.prototype is considered to be instanceof anotherWindow.DOMImplementation");
```

This seems like it should also pass, because case 2 passed...We'll need an algorithm tweak to handle this.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/129#issuecomment-226323731

Received on Wednesday, 15 June 2016 21:21:17 UTC