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

Unified Diff: tests/compiler/dart2js_native/native_class_fields_test.dart

Issue 11478050: Revert minification (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js_native/native_class_fields_test.dart
diff --git a/tests/compiler/dart2js_native/native_class_fields_test.dart b/tests/compiler/dart2js_native/native_class_fields_test.dart
deleted file mode 100644
index 8221eec9a0f3706201d7b88d6b80da74077e2927..0000000000000000000000000000000000000000
--- a/tests/compiler/dart2js_native/native_class_fields_test.dart
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// Verify that native fields on classes are not renamed by the minifier.
-class A native "*A" {
- int myLongPropertyName;
- int getValue;
-
- int method(int z) => myLongPropertyName;
-}
-
-
-void setup() native r"""
-function getter() {
- return ++this.getValue;
-}
-
-function setter(x) {
- this.getValue += 10;
-}
-
-function A(){
- var a = Object.create(
- { constructor: { name: 'A'}},
- { myLongPropertyName: { get: getter,
- set: setter,
- configurable: false,
- writeable: false
- }
- });
- a.getValue = 0;
- return a;
-}
-
-makeA = function(){return new A;};
-""";
-
-A makeA() native { return new A(); }
-
-main() {
- setup();
- var a = makeA();
- a.myLongPropertyName = 21;
- int gotten = a.myLongPropertyName;
- Expect.equals(11, gotten);
-
- var a2 = makeA();
- if (a2 is A) {
- // Inside this 'if' the compiler knows that a2 is an A, so it is tempted
- // to access myLongPropertyName directly, using its minified name. But
- // renaming of native properties can only work using getters and setters
- // that access the original name.
- a2.myLongPropertyName = 21;
- int gotten = a2.myLongPropertyName;
- Expect.equals(11, gotten);
- }
-}
-
« no previous file with comments | « tests/compiler/dart2js_extra/dart2js_extra.status ('k') | tests/compiler/dart2js_native/native_field_name_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698