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

Issue 11419250: Add @JSName annotation for native fields and methods - second try. (Closed)

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

Description

Add @JSName annotation for native fields and methods - second try. Committed: https://code.google.com/p/dart/source/detail?r=15569

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1491 lines, -873 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 +9 lines, -4 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 3 chunks +7 lines, -5 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/enqueue.dart View 2 chunks +2 lines, -0 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart View 5 chunks +53 lines, -8 lines 1 comment Download
M sdk/lib/_internal/compiler/implementation/js_backend/emitter_no_eval.dart View 1 chunk +5 lines, -30 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/js_backend/native_emitter.dart View 10 chunks +12 lines, -20 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/lib/js_helper.dart View 2 chunks +18 lines, -1 line 0 comments Download
M sdk/lib/_internal/compiler/implementation/native_handler.dart View 9 chunks +81 lines, -21 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/scanner/listener.dart View 2 chunks +2 lines, -2 lines 0 comments Download
M sdk/lib/_internal/compiler/implementation/ssa/codegen.dart View 3 chunks +7 lines, -3 lines 0 comments Download
M sdk/lib/html/dart2js/html_dart2js.dart View 1 2 180 chunks +900 lines, -526 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 5 chunks +29 lines, -4 lines 0 comments Download
M sdk/lib/html/scripts/systemhtml.py View 8 chunks +34 lines, -47 lines 0 comments Download
M sdk/lib/html/templates/html/dart2js/impl_IDBDatabase.darttemplate View 1 chunk +2 lines, -1 line 0 comments Download
M sdk/lib/html/templates/html/dart2js/impl_LocalWindow.darttemplate View 2 chunks +6 lines, -5 lines 0 comments Download
M sdk/lib/html/templates/html/dart2js/impl_TableElement.darttemplate View 1 chunk +2 lines, -1 line 0 comments Download
M sdk/lib/html/templates/html/impl/impl_Element.darttemplate View 3 chunks +6 lines, -6 lines 0 comments Download
M sdk/lib/html/templates/html/impl/impl_MutationObserver.darttemplate View 1 chunk +2 lines, -1 line 0 comments Download
M sdk/lib/svg/dart2js/svg_dart2js.dart View 54 chunks +180 lines, -70 lines 0 comments Download
M tests/compiler/dart2js_native/native_field_rename_1_frog_test.dart View 1 chunk +4 lines, -2 lines 0 comments Download
M tests/compiler/dart2js_native/native_field_rename_2_frog_test.dart View 1 chunk +4 lines, -2 lines 0 comments Download
M tests/compiler/dart2js_native/native_method_rename1_frog_test.dart View 1 chunk +8 lines, -3 lines 0 comments Download
M tests/compiler/dart2js_native/native_method_rename2_frog_test.dart View 1 chunk +4 lines, -2 lines 0 comments Download
M tests/compiler/dart2js_native/native_method_rename3_frog_test.dart View 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 1 (0 generated)
sra1
8 years ago (2012-11-30 07:12:17 UTC) #1
Message was sent while issue was closed.
Hi Erik,

This seems to have stuck.

It might be nice to structure your code in a similar way:

1. get the minified names for getter and setter.
2. If the names can be expressed as a field, use the field, else use explicit
getters/setters.

That way the code is more robust - if anything goes wrong, you get explicit
getters/setters which still work.

https://codereview.chromium.org/11419250/diff/5002/sdk/lib/_internal/compiler...
File sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (right):

https://codereview.chromium.org/11419250/diff/5002/sdk/lib/_internal/compiler...
sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart:837: if
(!getterAndSetterCanBeImplementedByFieldSpec(
Erik: This is a bit unsatisfactory that this function is called from both
emitClassFields and emitClassGettersSetter.

I would probably be best to merge these into one function that creates field
data or methods on a per member basis.

Powered by Google App Engine
This is Rietveld 408576698