Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Issue 12051056: Allow native classes to mixin behavior from an ordinary Dart class. (Closed)

Created:
7 years, 11 months ago by kasperl
Modified:
7 years, 11 months ago
Reviewers:
ngeoffray, sra1
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Allow native classes to mixin behavior from an ordinary Dart class. This is a little bit wonky so let me know if you have great ideas on how to make this cleaner. Clearly, we're going to need more test cases too. Note that trying to call mixed in methods using super will fail. If we want that to work we have to introduce aliases for such methods. R=sra@google.com,ngeoffray@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=17631

Patch Set 1 #

Patch Set 2 : Add comments. #

Total comments: 1

Patch Set 3 : Refactor. #

Total comments: 2

Patch Set 4 : Address review feedback. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -9 lines) Patch
M sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart View 1 2 3 5 chunks +72 lines, -7 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/native_handler.dart View 1 2 3 1 chunk +10 lines, -1 line 0 comments Download
A tests/compiler/dart2js_native/native_mixin_test.dart View 1 chunk +56 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
kasperl
7 years, 11 months ago (2013-01-24 11:00:51 UTC) #1
kasperl
https://codereview.chromium.org/12051056/diff/3001/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart File sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart (right): https://codereview.chromium.org/12051056/diff/3001/sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart#newcode104 sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart:104: if (method) { I removed this comment because the ...
7 years, 11 months ago (2013-01-24 11:06:54 UTC) #2
kasperl
An alternative to this (at least for members) is to teach dynamicBind about mixins. WDYT?
7 years, 11 months ago (2013-01-24 11:48:51 UTC) #3
ngeoffray
LGTM https://codereview.chromium.org/12051056/diff/5001/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart File sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (right): https://codereview.chromium.org/12051056/diff/5001/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart#newcode753 sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart:753: visitNativeMixins(classElement, (MixinApplicationElement mixin) { visitMixinsOfNativeClasses? https://codereview.chromium.org/12051056/diff/5001/sdk/lib/_internal/compiler/implementation/native_handler.dart File sdk/lib/_internal/compiler/implementation/native_handler.dart ...
7 years, 11 months ago (2013-01-24 11:55:53 UTC) #4
sra1
On 2013/01/24 11:48:51, kasperl wrote: > An alternative to this (at least for members) is ...
7 years, 11 months ago (2013-01-24 22:04:56 UTC) #5
sra1
7 years, 11 months ago (2013-01-24 22:05:21 UTC) #6
lgtm

Powered by Google App Engine
This is Rietveld 408576698