{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel/issues/1364","labels_url":"https://api.github.com/repos/babel/babel/issues/1364/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/1364/comments","events_url":"https://api.github.com/repos/babel/babel/issues/1364/events","html_url":"https://github.com/babel/babel/issues/1364","id":71462281,"number":1364,"title":"es6.spec.symbols transformer: add `instanceof` transformation","user":{"login":"getify","id":150330,"avatar_url":"https://avatars.githubusercontent.com/u/150330?v=3","gravatar_id":"","url":"https://api.github.com/users/getify","html_url":"https://github.com/getify","followers_url":"https://api.github.com/users/getify/followers","following_url":"https://api.github.com/users/getify/following{/other_user}","gists_url":"https://api.github.com/users/getify/gists{/gist_id}","starred_url":"https://api.github.com/users/getify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getify/subscriptions","organizations_url":"https://api.github.com/users/getify/orgs","repos_url":"https://api.github.com/users/getify/repos","events_url":"https://api.github.com/users/getify/events{/privacy}","received_events_url":"https://api.github.com/users/getify/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/babel/babel/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/babel/babel/labels/spec%20compliancy","name":"spec compliancy","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-28T02:54:47Z","updated_at":"2015-04-28T13:03:50Z","closed_at":null,"body":"It seems that currently `@@hasInstance` symbol support isn't in place, which means that `instanceof` checks aren't able to be overriden. I think in the same way that `typeof` checks are transformed with the optional `es6.spec.symbols`, so should `instanceof` checks."},"comment":{"url":"https://api.github.com/repos/babel/babel/issues/comments/97053779","html_url":"https://github.com/babel/babel/issues/1364#issuecomment-97053779","issue_url":"https://api.github.com/repos/babel/babel/issues/1364","id":97053779,"user":{"login":"getify","id":150330,"avatar_url":"https://avatars.githubusercontent.com/u/150330?v=3","gravatar_id":"","url":"https://api.github.com/users/getify","html_url":"https://github.com/getify","followers_url":"https://api.github.com/users/getify/followers","following_url":"https://api.github.com/users/getify/following{/other_user}","gists_url":"https://api.github.com/users/getify/gists{/gist_id}","starred_url":"https://api.github.com/users/getify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getify/subscriptions","organizations_url":"https://api.github.com/users/getify/orgs","repos_url":"https://api.github.com/users/getify/repos","events_url":"https://api.github.com/users/getify/events{/privacy}","received_events_url":"https://api.github.com/users/getify/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T13:03:50Z","updated_at":"2015-04-28T13:03:50Z","body":"Nope, this issue has nothing to do with \"symbol instanceof Symbol\". That's why I mentioned the `@@hasInstance` WKS.\r\n\r\nCode that illustrates:\r\n\r\n```js\r\nfunction Foo(greeting) {\r\n\tthis.greeting = greeting;\r\n}\r\n\r\n// override `instanceof` behavior for instances of `Foo`\r\nFoo[Symbol.hasInstance] = function(inst) {\r\n\treturn inst.greeting == \"hello\";\r\n};\r\n\r\nvar a = new Foo( \"hello\" ),\r\n\tb = new Foo( \"world\" );\r\n\r\na instanceof Foo;\t\t\t// true\r\nb instanceof Foo;\t\t\t// false\r\n```"}}