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

Issue 2896393003: Remove factory body in *.fromEnvironment, and implement this same behavior (Closed)

Created:
3 years, 7 months ago by Siggi Cherem (dart-lang)
Modified:
3 years, 6 months ago
CC:
reviews_dartlang.org, dart-uxr+reviews_google.com, ahe, Bob Nystrom
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Remove factory body in *.fromEnvironment, and implement this same behavior directly inside dart2js. A few notes: * I ended up adding support for this feature also in dart2js with --use-kernel, it was not implemented correctly before. This is why more tests are passing. * I played with two other ideas: (a) making this a compile-time error instead (b) making it a warning if the arguments were constant and implement it as a constant, treat it as an error if they were not. Unfortunately both are a breaking changes, so I backed out from them. IMO (a) is the cleanest thing to do long term, and we should raise this with the language team. R=efortuna@google.com Committed: https://github.com/dart-lang/sdk/commit/dd70d8b655bc1187f942779dd5455fab1f2f8045

Patch Set 1 #

Total comments: 3

Patch Set 2 : address comments and fix unit test #

Total comments: 1

Patch Set 3 : turn warning into a hint #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -35 lines) Patch
M pkg/compiler/lib/src/common_elements.dart View 1 chunk +3 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/diagnostics/messages.dart View 1 2 chunks +8 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/elements/entities.dart View 1 chunk +4 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/backend_impact.dart View 1 chunk +11 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/impact_transformer.dart View 1 chunk +3 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/mirrors_analysis.dart View 1 1 chunk +1 line, -0 lines 0 comments Download
M pkg/compiler/lib/src/js_backend/patch_resolver.dart View 1 1 chunk +8 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/kernel/element_map_impl.dart View 1 chunk +6 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/kernel/elements.dart View 2 chunks +8 lines, -1 line 0 comments Download
M pkg/compiler/lib/src/kernel/kernel_visitor.dart View 3 chunks +3 lines, -3 lines 0 comments Download
M pkg/compiler/lib/src/resolution/members.dart View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/ssa/builder.dart View 2 chunks +11 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/ssa/builder_kernel.dart View 2 chunks +21 lines, -2 lines 0 comments Download
M pkg/compiler/lib/src/ssa/kernel_impact.dart View 1 1 chunk +8 lines, -0 lines 0 comments Download
M pkg/compiler/lib/src/universe/feature.dart View 1 chunk +5 lines, -1 line 0 comments Download
M sdk/lib/_internal/js_runtime/lib/core_patch.dart View 1 2 3 chunks +0 lines, -18 lines 0 comments Download
M sdk/lib/_internal/js_runtime/lib/js_helper.dart View 1 chunk +4 lines, -0 lines 0 comments Download
M tests/compiler/dart2js/mock_libraries.dart View 1 chunk +1 line, -0 lines 0 comments Download
M tests/compiler/dart2js_extra/dart2js_extra.status View 1 chunk +1 line, -0 lines 0 comments Download
A tests/compiler/dart2js_extra/new_from_env_test.dart View 1 chunk +18 lines, -0 lines 0 comments Download
M tests/corelib/corelib.status View 2 chunks +0 lines, -5 lines 0 comments Download
M tests/language/language_dart2js.status View 2 chunks +2 lines, -4 lines 0 comments Download

Messages

Total messages: 16 (9 generated)
Siggi Cherem (dart-lang)
/cc rnystrom - Bob, I believe you might have done some special support in DDC ...
3 years, 7 months ago (2017-05-24 18:08:15 UTC) #7
Bob Nystrom
https://codereview.chromium.org/2896393003/diff/60001/pkg/compiler/lib/src/diagnostics/messages.dart File pkg/compiler/lib/src/diagnostics/messages.dart (right): https://codereview.chromium.org/2896393003/diff/60001/pkg/compiler/lib/src/diagnostics/messages.dart#newcode1088 pkg/compiler/lib/src/diagnostics/messages.dart:1088: "abstract class A {} main() { new bool.fromEnvironment('X'); }" ...
3 years, 7 months ago (2017-05-24 19:52:09 UTC) #9
Siggi Cherem (dart-lang)
https://codereview.chromium.org/2896393003/diff/60001/pkg/compiler/lib/src/diagnostics/messages.dart File pkg/compiler/lib/src/diagnostics/messages.dart (right): https://codereview.chromium.org/2896393003/diff/60001/pkg/compiler/lib/src/diagnostics/messages.dart#newcode1088 pkg/compiler/lib/src/diagnostics/messages.dart:1088: "abstract class A {} main() { new bool.fromEnvironment('X'); }" ...
3 years, 7 months ago (2017-05-24 20:37:19 UTC) #10
Siggi Cherem (dart-lang)
3 years, 7 months ago (2017-05-25 21:34:24 UTC) #12
Emily Fortuna
lgtm https://codereview.chromium.org/2896393003/diff/80001/pkg/compiler/lib/src/resolution/members.dart File pkg/compiler/lib/src/resolution/members.dart (right): https://codereview.chromium.org/2896393003/diff/80001/pkg/compiler/lib/src/resolution/members.dart#newcode3855 pkg/compiler/lib/src/resolution/members.dart:3855: // TODO(sigmund): consider turning this into a compile-time-error. ...
3 years, 6 months ago (2017-05-26 18:04:02 UTC) #13
Siggi Cherem (dart-lang)
On 2017/05/26 18:04:02, Emily Fortuna wrote: > lgtm > > https://codereview.chromium.org/2896393003/diff/80001/pkg/compiler/lib/src/resolution/members.dart > File pkg/compiler/lib/src/resolution/members.dart (right): ...
3 years, 6 months ago (2017-05-26 18:08:55 UTC) #14
Siggi Cherem (dart-lang)
3 years, 6 months ago (2017-05-26 21:49:26 UTC) #16
Message was sent while issue was closed.
Committed patchset #2 (id:80001) manually as
dd70d8b655bc1187f942779dd5455fab1f2f8045 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698