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

Issue 1362553002: dart2js runtime: Harden objectTypeName. (Closed)

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

Description

dart2js runtime: Harden objectTypeName. 1. Avoid crashing on short minified names. 2. Try to find a better name for external JavaScript classes. 3. Try to find a better name for undistingushed native classes. BUG= http://dartbug.com/24393 This is related to http://dartbug.com/19137 R=sigmund@google.com Committed: https://github.com/dart-lang/sdk/commit/5612c202a02e2f39dec8914aa74661d813a92ce5

Patch Set 1 : #

Total comments: 12

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+229 lines, -12 lines) Patch
M sdk/lib/_internal/js_runtime/lib/js_helper.dart View 1 2 3 2 chunks +60 lines, -12 lines 0 comments Download
A tests/compiler/dart2js_native/error_safeToString_test.dart View 1 1 chunk +169 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (2 generated)
sra1
5 years, 3 months ago (2015-09-22 06:12:54 UTC) #3
Siggi Cherem (dart-lang)
lgtm, just minor comments below https://codereview.chromium.org/1362553002/diff/20001/sdk/lib/_internal/js_runtime/lib/js_helper.dart File sdk/lib/_internal/js_runtime/lib/js_helper.dart (right): https://codereview.chromium.org/1362553002/diff/20001/sdk/lib/_internal/js_runtime/lib/js_helper.dart#newcode876 sdk/lib/_internal/js_runtime/lib/js_helper.dart:876: // We get here ...
5 years, 3 months ago (2015-09-22 16:51:23 UTC) #4
sra1
Committed patchset #4 (id:80001) manually as 5612c202a02e2f39dec8914aa74661d813a92ce5 (presubmit successful).
5 years, 3 months ago (2015-09-22 21:46:36 UTC) #5
sra1
5 years, 3 months ago (2015-09-23 03:58:21 UTC) #6
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/1362553002/diff/20001/sdk/lib/_interna...
File sdk/lib/_internal/js_runtime/lib/js_helper.dart (right):

https://chromiumcodereview.appspot.com/1362553002/diff/20001/sdk/lib/_interna...
sdk/lib/_internal/js_runtime/lib/js_helper.dart:876: // We get here via the
UnknownJavaScriptObject test for JavaScript objects
On 2015/09/22 16:51:23, Siggi Cherem (dart-lang) wrote:
> We get here ... The object's
>    =>
> If we get here ... Then, the object's
> ^^                 ^^^^

Acknowledged.

https://chromiumcodereview.appspot.com/1362553002/diff/20001/sdk/lib/_interna...
sdk/lib/_internal/js_runtime/lib/js_helper.dart:879: // We get here the
Interceptor test for Native classes that are declared
On 2015/09/22 16:51:23, Siggi Cherem (dart-lang) wrote:
> We get here the ... The native
>   =>
> If we get here via the  ... Then, the native
> ^^             ^^^          ^^^^

Acknowledged.

https://chromiumcodereview.appspot.com/1362553002/diff/20001/tests/compiler/d...
File tests/compiler/dart2js_native/error_safeToString_test.dart (right):

https://chromiumcodereview.appspot.com/1362553002/diff/20001/tests/compiler/d...
tests/compiler/dart2js_native/error_safeToString_test.dart:45: x.constructor =
null;  // Foils constructor lookup.
On 2015/09/22 16:51:23, Siggi Cherem (dart-lang) wrote:
> Foils => Fails? (same below)

To foil is to prevent from succeeding, "a brave policewoman foiled the armed
robbery".

https://chromiumcodereview.appspot.com/1362553002/diff/20001/tests/compiler/d...
tests/compiler/dart2js_native/error_safeToString_test.dart:116: print('A  $x 
${Error.safeToString(x)}');
On 2015/09/22 16:51:23, Siggi Cherem (dart-lang) wrote:
> do you need to keep the prints in the test? or where they mainly for
debugging?

I'll remove them.

https://chromiumcodereview.appspot.com/1362553002/diff/20001/tests/compiler/d...
tests/compiler/dart2js_native/error_safeToString_test.dart:145:
Expect.notEquals("Instance of 'PP'", Error.safeToString(x));
On 2015/09/22 16:51:23, Siggi Cherem (dart-lang) wrote:
> Do we prevent minification from picking names we've seen in @Native? (any
chance
> that the minifier picks PP for the minified name of Purple?)

Good point.  Changed to PPPP.

https://chromiumcodereview.appspot.com/1362553002/diff/20001/tests/compiler/d...
tests/compiler/dart2js_native/error_safeToString_test.dart:156: // The toString
calls (interpolation) force Rascal to be distinguished.
On 2015/09/22 16:51:23, Siggi Cherem (dart-lang) wrote:
> maybe also make a note here that this is because Rascal overrides toString?

Done.

Powered by Google App Engine
This is Rietveld 408576698