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

Issue 11299220: Add @JSName annotation for native fields and methods. (Closed)

Created:
8 years ago by sra1
Modified:
8 years ago
Reviewers:
erikcorry, ahe, ngeoffray, blois
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add @JSName annotation for native fields and methods. This change allows fields to have different Dart and JavaScript names without resorting to getters and setters using the 'JS' call. For uniformity, methods have been changed use @JSName too. The previous scheme of using a string containing an identifier following the 'native' pseudo-keyword is now an error. A non-identifier string, giving a native body to a Dart function, is still supported. Members are marked as native during resolution, making the Element.isNative() predicate more reliable. Some uses of nativeName have been renamed to nativeTagInfo or nativeTag to reflect that the strings are actually the class names. Committed: https://code.google.com/p/dart/source/detail?r=15493

Patch Set 1 #

Total comments: 1

Patch Set 2 : merge #

Patch Set 3 : Fix _NodeList #

Total comments: 6

Patch Set 4 : #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+1369 lines, -821 lines) Patch
M sdk/lib/_internal/compiler/implementation/apiimpl.dart View 1 chunk +3 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/compiler.dart View 1 chunk +5 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/dart2js.dart View 1 chunk +1 line, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/elements/elements.dart View 1 2 3 3 chunks +7 lines, -5 lines 2 comments Download
M sdk/lib/_internal/compiler/implementation/enqueue.dart View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart View 1 2 3 3 chunks +7 lines, -3 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart View 10 chunks +12 lines, -21 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/js_helper.dart View 1 2 3 2 chunks +18 lines, -1 line 2 comments Download
M sdk/lib/_internal/compiler/implementation/native_handler.dart View 1 2 3 9 chunks +77 lines, -20 lines 6 comments Download
M sdk/lib/_internal/compiler/implementation/scanner/listener.dart View 1 2 chunks +2 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/codegen.dart View 1 2 3 3 chunks +7 lines, -3 lines 0 comments Download
M sdk/lib/html/dart2js/html_dart2js.dart View 1 2 3 176 chunks +861 lines, -522 lines 0 comments Download
M sdk/lib/html/dartium/html_dartium.dart View 3 chunks +106 lines, -106 lines 0 comments Download
M sdk/lib/html/scripts/generator.py View 1 2 5 chunks +29 lines, -4 lines 0 comments Download
M sdk/lib/html/scripts/systemhtml.py View 1 2 3 8 chunks +34 lines, -47 lines 0 comments Download
M sdk/lib/html/templates/html/dart2js/impl_IDBDatabase.darttemplate View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M sdk/lib/html/templates/html/dart2js/impl_LocalWindow.darttemplate View 1 2 3 2 chunks +6 lines, -5 lines 0 comments Download
M sdk/lib/html/templates/html/dart2js/impl_TableElement.darttemplate View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M sdk/lib/html/templates/html/impl/impl_Element.darttemplate View 1 2 3 3 chunks +6 lines, -6 lines 0 comments Download
M sdk/lib/html/templates/html/impl/impl_MutationObserver.darttemplate View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M sdk/lib/svg/dart2js/svg_dart2js.dart View 1 2 3 54 chunks +180 lines, -70 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
sra1
Nicolas: please review the compiler stuff. Pete: the generator and generated results.
8 years ago (2012-11-27 23:54:28 UTC) #1
ngeoffray
LGTM! It looks like you could also remove the 'native' suffix on the declaration of ...
8 years ago (2012-11-28 20:31:23 UTC) #2
blois
lgtm https://codereview.chromium.org/11299220/diff/1/sdk/lib/html/scripts/systemhtml.py File sdk/lib/html/scripts/systemhtml.py (right): https://codereview.chromium.org/11299220/diff/1/sdk/lib/html/scripts/systemhtml.py#newcode513 sdk/lib/html/scripts/systemhtml.py:513: #if attribute.id != html_name: Remove?
8 years ago (2012-11-28 21:50:55 UTC) #3
ngeoffray
+ahe for the annotation parsing
8 years ago (2012-11-29 08:40:54 UTC) #4
ahe
DBC https://codereview.chromium.org/11299220/diff/4004/sdk/lib/_internal/compiler/implementation/elements/elements.dart File sdk/lib/_internal/compiler/implementation/elements/elements.dart (right): https://codereview.chromium.org/11299220/diff/4004/sdk/lib/_internal/compiler/implementation/elements/elements.dart#newcode358 sdk/lib/_internal/compiler/implementation/elements/elements.dart:358: String _nativeName = null; Please follow this layout ...
8 years ago (2012-11-29 09:19:26 UTC) #5
erikcorry
I'm sorry I seem to have sabotaged this with my rollback. I tried putting it ...
8 years ago (2012-11-29 12:55:21 UTC) #6
sra1
https://chromiumcodereview.appspot.com/11299220/diff/5001/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart File sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (right): https://chromiumcodereview.appspot.com/11299220/diff/5001/sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart#newcode782 sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart:782: : accessorName; On 2012/11/28 20:31:23, ngeoffray wrote: > fits ...
8 years ago (2012-12-04 01:31:31 UTC) #7
erikcorry
8 years ago (2012-12-04 09:33:26 UTC) #8
Message was sent while issue was closed.
This was reverted, the new version is https://codereview.chromium.org/11419250/

Powered by Google App Engine
This is Rietveld 408576698