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

Issue 416873002: Don't include class-static functions in library mirror. (Closed)

Created:
6 years, 5 months ago by floitsch
Modified:
5 years, 10 months ago
Reviewers:
Johnni Winther, ahe
CC:
reviews_dartlang.org, ahe
Visibility:
Public.

Description

Don't include class-static functions in library mirror. Also removes code that checked if a library-function was a constructor. BUG= http://dartbug.com/12133 Committed: https://code.google.com/p/dart/source/detail?r=38589 Reverted: https://code.google.com/p/dart/source/detail?r=38590 Committed: https://code.google.com/p/dart/source/detail?r=38593 Reverted: https://code.google.com/p/dart/source/detail?r=38601

Patch Set 1 #

Patch Set 2 : Don't include class-static functions in library mirror. #

Patch Set 3 : Fix typos. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -22 lines) Patch
M sdk/lib/_internal/compiler/implementation/js_emitter/reflection_data_parser.dart View 1 6 chunks +10 lines, -8 lines 1 comment Download
M sdk/lib/_internal/lib/isolate_helper.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/lib/js_mirrors.dart View 1 chunk +2 lines, -6 lines 0 comments Download
M tests/lib/lib.status View 1 2 1 chunk +2 lines, -1 line 0 comments Download
A tests/lib/mirrors/library_declarations2_test.dart View 1 2 1 chunk +31 lines, -0 lines 2 comments Download
M tests/lib/mirrors/library_declarations_test.dart View 1 4 chunks +3 lines, -6 lines 1 comment Download

Messages

Total messages: 6 (0 generated)
floitsch
6 years, 5 months ago (2014-07-24 15:49:10 UTC) #1
ahe
lgtm
6 years, 5 months ago (2014-07-24 18:23:34 UTC) #2
floitsch
Committed patchset #1 manually as r38589 (presubmit successful).
6 years, 5 months ago (2014-07-25 20:43:03 UTC) #3
floitsch
Committed patchset #1 manually as r38593 (presubmit successful).
6 years, 5 months ago (2014-07-25 21:22:14 UTC) #4
floitsch
PTAL. The reason the check was needed, was because of the bug that we added ...
6 years, 4 months ago (2014-07-28 17:47:23 UTC) #5
ahe
6 years, 4 months ago (2014-08-04 09:19:40 UTC) #6
LGTM!

https://chromiumcodereview.appspot.com/416873002/diff/40001/sdk/lib/_internal...
File
sdk/lib/_internal/compiler/implementation/js_emitter/reflection_data_parser.dart
(right):

https://chromiumcodereview.appspot.com/416873002/diff/40001/sdk/lib/_internal...
sdk/lib/_internal/compiler/implementation/js_emitter/reflection_data_parser.dart:216:
if (!init.staticFunctions) init.staticFunctions = map();
At first, this change put me off. Then I checked the specification of
MethodMirror.isStatic, and it does say that top-level functions are also
considered static. This is slightly confusing, because we don't allow the static
keyword on top-level functions.

What "isStatic" really means is "not an instance method, and not a constructor".

Regardless, using the term "staticFunctions" matches the use in dart:mirrors. So
I'm no longer put off by this change.

In other parts of the compiler, we have used the terminology "global" to refer
to static and top-level elements (I actually think that you introduced this
term). For that reason, I suggest you change the above comment to say:

[staticFunctions] contains all static functions (including top-level functions).
This is used ...

https://chromiumcodereview.appspot.com/416873002/diff/40001/tests/lib/mirrors...
File tests/lib/mirrors/library_declarations2_test.dart (right):

https://chromiumcodereview.appspot.com/416873002/diff/40001/tests/lib/mirrors...
tests/lib/mirrors/library_declarations2_test.dart:5: library
test.library_declarations_test;
For consistency, consider changing name to match file name (add 2 after
declarations).

https://chromiumcodereview.appspot.com/416873002/diff/40001/tests/lib/mirrors...
tests/lib/mirrors/library_declarations2_test.dart:7: @MirrorsUsed(targets:
"test.library_declarations_test")
Ditto.

https://chromiumcodereview.appspot.com/416873002/diff/40001/tests/lib/mirrors...
File tests/lib/mirrors/library_declarations_test.dart (left):

https://chromiumcodereview.appspot.com/416873002/diff/40001/tests/lib/mirrors...
tests/lib/mirrors/library_declarations_test.dart:26: return;  /// 01: ok
\o/

Powered by Google App Engine
This is Rietveld 408576698