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

Issue 21430002: Allow InstanceMirror.invoke to find private members. Resolves issue 11771. (Closed)

Created:
7 years, 4 months ago by rmacnak
Modified:
7 years, 4 months ago
Reviewers:
ahe, siva
CC:
reviews_dartlang.org, ahe, Michael Lippautz (Google)
Visibility:
Public.

Description

Allow InstanceMirror.invoke to find private members. Resolves issue 11771. R=asiva@google.com Committed: https://code.google.com/p/dart/source/detail?r=25690

Patch Set 1 #

Total comments: 3

Patch Set 2 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -6 lines) Patch
M runtime/lib/mirrors.cc View 1 2 chunks +15 lines, -6 lines 0 comments Download
M tests/lib/lib.status View 1 chunk +1 line, -0 lines 0 comments Download
A tests/lib/mirrors/invoke_private_test.dart View 1 1 chunk +86 lines, -0 lines 1 comment Download

Messages

Total messages: 6 (0 generated)
rmacnak
7 years, 4 months ago (2013-07-31 22:54:35 UTC) #1
siva
lgtm https://chromiumcodereview.appspot.com/21430002/diff/1/tests/lib/mirrors/invoke_private_test.dart File tests/lib/mirrors/invoke_private_test.dart (right): https://chromiumcodereview.appspot.com/21430002/diff/1/tests/lib/mirrors/invoke_private_test.dart#newcode35 tests/lib/mirrors/invoke_private_test.dart:35: // InstanceMirror '.' https://chromiumcodereview.appspot.com/21430002/diff/1/tests/lib/mirrors/invoke_private_test.dart#newcode52 tests/lib/mirrors/invoke_private_test.dart:52: // ClassMirror Ditto. ...
7 years, 4 months ago (2013-07-31 23:17:34 UTC) #2
rmacnak
Fixed comments and removed newly-dead include.
7 years, 4 months ago (2013-07-31 23:28:03 UTC) #3
siva
lgtm
7 years, 4 months ago (2013-07-31 23:35:02 UTC) #4
rmacnak
Committed patchset #2 manually as r25690 (presubmit successful).
7 years, 4 months ago (2013-07-31 23:45:16 UTC) #5
ahe
7 years, 4 months ago (2013-08-02 06:45:24 UTC) #6
Message was sent while issue was closed.
This test is rather broken: to create a private name, two things are needed: a
library and an identifier.

This test is assuming you can create a "wildcard" private ne that matches any
private identifier, but unfortunately, that wouldn't work as you can inherit
private members across libraries, meaning that such names become ambiguous.

https://chromiumcodereview.appspot.com/21430002/diff/7001/tests/lib/mirrors/i...
File tests/lib/mirrors/invoke_private_test.dart (right):

https://chromiumcodereview.appspot.com/21430002/diff/7001/tests/lib/mirrors/i...
tests/lib/mirrors/invoke_private_test.dart:41: result = im.getField(const
Symbol('_getter'));
It is a bug in the VM if it accepts this.

When I implemented this a few months ago, this was a compile-time error and
recognized as such by the VM:
https://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/test...

The specification of Symbol constructor also clearly states that this is an
argument error:
https://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/sdk/...

Combine this with the language specification that says that any error arising
during the evaluation of a constant is a compile-time error.

Consequently, this is a compile-time error.

Powered by Google App Engine
This is Rietveld 408576698