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

Unified Diff: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java

Issue 22481002: Issue 12158. Report error when user code uses 'native' clause. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
diff --git a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
index 85d91522632192780151c3d63be169bae55e29c1..ce0ac46165713f35c9b291040ca7f4d1386a322f 100644
--- a/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
+++ b/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/resolver/CompileTimeErrorCodeTest.java
@@ -2132,6 +2132,16 @@ public class CompileTimeErrorCodeTest extends ResolverTestCase {
verify(source);
}
+ public void test_nativeClauseInNonSDKCode() throws Exception {
+ // TODO(jwren) Move this test somewhere else: This test verifies a parser error code is generated
+ // through the ErrorVerifier, it is not a CompileTimeErrorCode.
+ Source source = addSource(createSource(//
+ "class A native 'string' {}"));
+ resolve(source);
+ assertErrors(ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE);
+ verify(source);
+ }
+
public void test_nativeFunctionBodyInNonSDKCode_function() throws Exception {
// TODO(jwren) Move this test somewhere else: This test verifies a parser error code is generated
// through the ErrorVerifier, it is not a CompileTimeErrorCode.

Powered by Google App Engine
This is Rietveld 408576698