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

Unified Diff: compiler/javatests/com/google/dart/compiler/end2end/NativeTest.dart

Issue 9421001: Issue 1606/1108. The 'native' keyword is supposed to only be allowed in core libraries. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 months 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: compiler/javatests/com/google/dart/compiler/end2end/NativeTest.dart
diff --git a/compiler/javatests/com/google/dart/compiler/end2end/NativeTest.dart b/compiler/javatests/com/google/dart/compiler/end2end/NativeTest.dart
deleted file mode 100644
index e97cdeddfdcfc06f3cd56f907f1ee12356d16e94..0000000000000000000000000000000000000000
--- a/compiler/javatests/com/google/dart/compiler/end2end/NativeTest.dart
+++ /dev/null
@@ -1,62 +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.
-
-class NativeClass native "FooBar" {
- factory NativeClass() {
- return _createFooBar();
- }
-
- int foo(x, y) { return x + y + 499; }
- int bar(x, y) native;
- static toto(x, y) { return x - y + 499; }
- static NativeClass _createFooBar() native;
-}
-
-
-interface A {
- foo();
-}
-
-class NativeA implements A native "JSA" {
- factory NativeA() {
- return _new();
- }
- foo(){}
-
- static _new() native;
-}
-
-class NativeTest {
- static int counter;
-
- static int jsIncrementBy(x, y) native;
-
- static int dartIncrementBy(int x, int y) native {
- counter += x + y;
- return counter;
- }
-
- static void testRoundTrip() {
- counter = 0;
- var passedThrough = jsIncrementBy(3, 4);
- assert(passedThrough == 7);
- assert(counter == 7);
- }
-
- static void testNativeClass() {
- assert(NativeClass.toto(1, 1) == 499);
- NativeClass nc = new NativeClass();
- assert(nc is NativeClass);
- assert(nc.foo(1, 524) == 1024);
- assert(nc.bar(1, 499) == -1);
- NativeA na = new NativeA();
- assert(na is NativeA);
- assert(na is A);
- }
-}
-
-main() {
- NativeTest.testRoundTrip();
- NativeTest.testNativeClass();
-}

Powered by Google App Engine
This is Rietveld 408576698