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

Issue 1213033002: Fix runtimeType.toString for tear-offs. (Closed)

Created:
5 years, 5 months ago by floitsch
Modified:
5 years, 5 months ago
Reviewers:
sra1
CC:
reviews_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix runtimeType.toString for tear-offs. Tear-offs are constructed by building a fresh constructor on the fly. However, that constructor is unnamed and didn't have the 'builtin$cls' property set. As such, the runtime-type system was unable to extract a good name and wasn't able to provide a good 'toString' for it. With this CL the constructor has a good 'name' set. Also removes the 'builtin$cls' property that was a duplicate of 'name'. Whenever we defined a new Dart class, we added a 'builtin$cls' property on the constructor which was a duplicate of the name. This was necessary, because IE doesn't store the function name on the constructor. However, there we can just assign the 'name' field, and don't need to introduce a new field-name ('builtin$cls'). As such, we can always use the 'name' property. R=sra@google.com Committed: https://github.com/dart-lang/sdk/commit/87a7ca0720f066c51c6f8884bb93b50183aaabe7

Patch Set 1 #

Total comments: 7

Patch Set 2 : Address comments. #

Patch Set 3 : Improved test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+67 lines, -27 lines) Patch
M pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart View 1 3 chunks +2 lines, -4 lines 0 comments Download
M pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart View 1 5 chunks +7 lines, -6 lines 0 comments Download
M pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart View 1 4 chunks +6 lines, -7 lines 0 comments Download
M pkg/compiler/lib/src/js_emitter/old_emitter/setup_program_builder.dart View 1 2 chunks +1 line, -4 lines 0 comments Download
M sdk/lib/_internal/js_runtime/lib/js_helper.dart View 1 2 chunks +25 lines, -6 lines 0 comments Download
A tests/language/runtime_type2_test.dart View 1 2 1 chunk +26 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (1 generated)
floitsch
5 years, 5 months ago (2015-06-26 21:50:01 UTC) #2
sra1
lgtm but please expand description to say what is being fixed, perhaps a before & ...
5 years, 5 months ago (2015-06-26 23:10:10 UTC) #3
floitsch
https://codereview.chromium.org/1213033002/diff/1/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart File pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart (right): https://codereview.chromium.org/1213033002/diff/1/pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart#newcode1186 pkg/compiler/lib/src/js_emitter/new_emitter/model_emitter.dart:1186: if (typeof constructor.name != 'string') { On 2015/06/26 23:10:09, ...
5 years, 5 months ago (2015-07-01 17:00:15 UTC) #4
sra1
https://codereview.chromium.org/1213033002/diff/1/tests/language/runtime_type2_test.dart File tests/language/runtime_type2_test.dart (right): https://codereview.chromium.org/1213033002/diff/1/tests/language/runtime_type2_test.dart#newcode17 tests/language/runtime_type2_test.dart:17: runtimeStringFoo != "" && runtimeStringFoo != "undefined"); On 2015/07/01 ...
5 years, 5 months ago (2015-07-01 17:12:59 UTC) #5
floitsch
5 years, 5 months ago (2015-07-01 19:14:12 UTC) #6
sra1
lgtm
5 years, 5 months ago (2015-07-01 19:15:49 UTC) #7
floitsch
5 years, 5 months ago (2015-07-02 08:59:36 UTC) #8
Message was sent while issue was closed.
Committed patchset #3 (id:40001) manually as
87a7ca0720f066c51c6f8884bb93b50183aaabe7 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698