Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

private method in library L is accessible from code outside of L #2141

Closed
DartBot opened this issue Mar 14, 2012 · 8 comments
Closed

private method in library L is accessible from code outside of L #2141

DartBot opened this issue Mar 14, 2012 · 8 comments
Assignees
Labels
closed-obsolete Closed as the reported issue is no longer relevant P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js

Comments

@DartBot
Copy link

DartBot commented Mar 14, 2012

This issue was originally filed by ross.m....@gmail.com


What steps will reproduce the problem?

  1. create a private method on a class in your library ('_' prefix)
  2. call the private method on an instance of your class from an application or code that is not in your library
  3. see that there are no compilation warnings or errors and that it runs!

What is the expected output? What do you see instead?

The spec (0.07) says I should expect this:

"Libraries are units of privacy. A private declaration declared within a library L can only be accessed by code within L. Any attempt to access a private member declaration from outside L will cause a method, getter or setter lookup failure."

What version of the product are you using? On what operating system?

Dart Editor build 5205 , compiled to js with Frog, on Windows 7 64 bit

Please provide any additional information below.

@madsager
Copy link
Contributor

Added Area-Frog, Triaged labels.

@kasperl
Copy link

kasperl commented Mar 14, 2012

Can you provide some actual source code? I can't seem to reproduce this with Frog r5451.


Added NeedsInfo label.

@DartBot
Copy link
Author

DartBot commented Mar 15, 2012

This comment was originally written by ross.m....@gmail.com


Hi Kasper,

I have attached a sample project that recreates this for me. The application 'privacytest' is calling a private method _test() on an instance of Foo that it creates. Foo is in a separate library called 'testlibrary'. This reproduces the issue for me with Dart Editor 5205. I haven't tried anything newer since 5205 is pretty stable for me at the moment, but perhaps it has been resolved since.

thanks!


Attachment:
privacytest.zip (2.13 KB)

@kasperl
Copy link

kasperl commented Mar 16, 2012

Thanks for the repro, Ross! This is very useful.


Set owner to @kasperl.
Removed Priority-Medium label.
Added Priority-High, Accepted labels.

@anders-sandholm
Copy link
Contributor

Removed Area-Frog label.
Added Area-Dart2JS, OldAreaFrog labels.

@anders-sandholm
Copy link
Contributor

Removed OldAreaFrog label.
Added FromAreaFrog label.

@kasperl
Copy link

kasperl commented Jun 8, 2012

Added AssumedStale label.

@DartBot
Copy link
Author

DartBot commented Jun 10, 2012

This comment was originally written by ross.m.smith...@gmail.com


I can confirm (build 8370) that this now throws a NoSuchMethodException:

Exception: NoSuchMethodException : method not found: '_test@2bdeb766'
Receiver: Instance of 'Foo'

thanks!

@DartBot DartBot added Type-Defect P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js closed-obsolete Closed as the reported issue is no longer relevant labels Jun 10, 2012
copybara-service bot pushed a commit that referenced this issue Jun 20, 2023
… webdev

Revisions updated by `dart tools/rev_sdk_deps.dart`.

bazel_worker (https://github.com/dart-lang/bazel_worker/compare/c14a268..f7b714e):
  f7b714e  2023-06-16  Jacob MacDonald  add firehose publishing workflow (#76)
  0743f11  2023-06-16  Parker Lougheed  Require protobuf 3.0.0 and prepare for 1.0.3 release (#75)

dartdoc (https://github.com/dart-lang/dartdoc/compare/5799424..793d575):
  793d575d  2023-06-14  Sam Rawlins  Remove unused coverage feature (#3444)
  19ad21a4  2023-06-14  Parker Lougheed  Replace `@sealed` meta usage with keyword (#3445)
  8e9d89e3  2023-06-12  Sam Rawlins  Remove all `@deprecated` elements. (#3250)
  2019791c  2023-06-12  dependabot[bot]  Bump actions/checkout from 3.5.2 to 3.5.3 (#3442)
  d34c7067  2023-06-12  dependabot[bot]  Bump github/codeql-action from 2.3.6 to 2.13.4 (#3443)

http (https://github.com/dart-lang/http/compare/ba7eb60..8c25057):
  8c25057  2023-06-16  Nate Bosch  Unskip a skipped test (#966)

protobuf (https://github.com/dart-lang/protobuf/compare/a9bf79f..e76bd74):
  e76bd74  2023-06-19  Ömer Sinan Ağacan  Remove protoc_plugin exe from repo, update .gitignore (#851)
  4b71e60  2023-06-16  Ömer Sinan Ağacan  Fix a change in protoc_plugin changelog (#846)
  f4ffa1d  2023-06-16  Ömer Sinan Ağacan  Fix missing protobuf import in grpc files (#845)

source_maps (https://github.com/dart-lang/source_maps/compare/dd5b5cd..58eef30):
  58eef30  2023-06-12  Kevin Moore  Require Dart 3, update lints (#79)

tools (https://github.com/dart-lang/tools/compare/8d6e8b8..02b5cc5):
  02b5cc5  2023-06-16  Brian Wilkerson  Add documentation for server events (#115)
  698bfe8  2023-06-15  Elias Yishak  Introducing new `Event` class that can be send via `analytics.send(Event event)` (#114)

webdev (https://github.com/dart-lang/webdev/compare/81ae77a..b58edb7):
  b58edb7d  2023-06-16  Elliott Brooks  Fix the DCM workflow (#2147)
  1551fe6c  2023-06-16  Elliott Brooks  Wrap VM service API methods in an error handler to convert any exceptions into type `RPCError`
(#2144)
  06abe901  2023-06-14  Elliott Brooks  Add more tests to daily testing cron job (#2138)
  5cb2dcf6  2023-06-13  Elliott Brooks  Use new error codes from package:vm_service (#2141)

Change-Id: I6779c6d20fbc69e83848f469df3e0b4d21420a9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/310322
Auto-Submit: Devon Carew <devoncarew@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-obsolete Closed as the reported issue is no longer relevant P1 A high priority bug; for example, a single project is unusable or has many test failures web-dart2js
Projects
None yet
Development

No branches or pull requests

4 participants