{"action":"closed","issue":{"url":"https://api.github.com/repos/dart-lang/sdk/issues/8942","labels_url":"https://api.github.com/repos/dart-lang/sdk/issues/8942/labels{/name}","comments_url":"https://api.github.com/repos/dart-lang/sdk/issues/8942/comments","events_url":"https://api.github.com/repos/dart-lang/sdk/issues/8942/events","html_url":"https://github.com/dart-lang/sdk/issues/8942","id":84529510,"number":8942,"title":"dart2js: Object is using mixed up calling conventions","user":{"login":"rakudrama","id":2108821,"avatar_url":"https://avatars.githubusercontent.com/u/2108821?v=3","gravatar_id":"","url":"https://api.github.com/users/rakudrama","html_url":"https://github.com/rakudrama","followers_url":"https://api.github.com/users/rakudrama/followers","following_url":"https://api.github.com/users/rakudrama/following{/other_user}","gists_url":"https://api.github.com/users/rakudrama/gists{/gist_id}","starred_url":"https://api.github.com/users/rakudrama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rakudrama/subscriptions","organizations_url":"https://api.github.com/users/rakudrama/orgs","repos_url":"https://api.github.com/users/rakudrama/repos","events_url":"https://api.github.com/users/rakudrama/events{/privacy}","received_events_url":"https://api.github.com/users/rakudrama/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Area-Dart2JS","name":"Area-Dart2JS","color":"ededed"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Priority-Medium","name":"Priority-Medium","color":"ededed"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Triaged","name":"Triaged","color":"ededed"},{"url":"https://api.github.com/repos/dart-lang/sdk/labels/Type-Defect","name":"Type-Defect","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2013-03-06T05:46:04Z","updated_at":"2015-06-19T20:08:10Z","closed_at":"2015-06-19T20:08:10Z","body":"There are four calling 'conventions':\n\n#­1. direct:           receiver.foo(arg)\n\nAnd three variations of passing an explicit receiver:\n\n#­2. intercepted:      interceptor.foo(receiver, arg)\nThe interceptor and receiver are (potentially) different objects; the receiver is passed as the first parameter and its receiver is passed as the 'this' parameter.\n\n#­3. interceptor:      receiver.foo(receiver, arg)\nUsed in a context where all possible receivers are self-intercepting, but the method may be reached by an interceptor or a self-intercepting class.  Example: a method from a mixin placed on a plain class and an intercepted class will need a correct explicit receiver, even if we know the receiver is a plain class.\n\n#­4. ignored-explicit-receiver: receiver.foo(0, arg)\nSmaller call site used when the set of 'foo' implementations are all for self-intercepting classes and access the receiver via 'this'.\n\n#­3 is a current optimization of #­2 when no genuine interceptors are possible.\n#­4 is a future optimization of #­3.\n\n\nBy convention, ignored-receiver methods rename the 'receiver' first argument to '_' and don't use it.\n\nObject seems very confused:\n\n$$.Object = {&quot;&quot;: &quot;;&quot;,\n&nbsp;&nbsp;//// $eq names the receiver but ignores it!!!\n&nbsp;&nbsp;$eq: function(receiver, other) {\n&nbsp;&nbsp;&nbsp;&nbsp;return this &equals;&equals;&equals; other;\n&nbsp;&nbsp;},\n&nbsp;&nbsp;//// get$hashCode has an ignored-receiver name, but uses it!!!\n&nbsp;&nbsp;get$hashCode: function(_) {\n&nbsp;&nbsp;&nbsp;&nbsp;return $.Primitives_objectHashCode(_);\n&nbsp;&nbsp;},\n&nbsp;&nbsp;toString$0: function(_) {\n&nbsp;&nbsp;&nbsp;&nbsp;return &quot;Instance of '&quot; + $.S($.Primitives_objectTypeName(_)) + &quot;'&quot;;\n&nbsp;&nbsp;}\n};\n\n\nWe need to decide if Object can subclassed by an interceptor class or by a regular class.\nIf it is both, then we can't use convention #­4 for methods on Object, and we need to fix $eq and whatever is causing the incorrect naming of the 'receiver' parameter."}}