| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 class SyntaxTest { | 5 class SyntaxTest { |
| 6 // "this" cannot be used as a field name. | 6 // "this" cannot be used as a field name. |
| 7 SyntaxTest this; /// 01: compile-time error | 7 SyntaxTest this; /// 01: compile-time error |
| 8 | 8 |
| 9 // Syntax error. | 9 // Syntax error. |
| 10 foo {} /// 02: compile-time error | 10 foo {} /// 02: compile-time error |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 {} | 93 {} |
| 94 | 94 |
| 95 class Console | 95 class Console |
| 96 native "=(typeof console == 'undefined' ? {} : console)" /// 29: compile-time er
ror | 96 native "=(typeof console == 'undefined' ? {} : console)" /// 29: compile-time er
ror |
| 97 {} | 97 {} |
| 98 | 98 |
| 99 class NativeClass | 99 class NativeClass |
| 100 native "FooBar" /// 30: compile-time error | 100 native "FooBar" /// 30: compile-time error |
| 101 {} | 101 {} |
| 102 | 102 |
| 103 interface Fisk {} | 103 abstract class Fisk {} |
| 104 | 104 |
| 105 class BoolImplementation implements Fisk | 105 class BoolImplementation implements Fisk |
| 106 native "Boolean" /// 31: compile-time error | 106 native "Boolean" /// 31: compile-time error |
| 107 {} | 107 {} |
| 108 | 108 |
| 109 class _JSON | 109 class _JSON |
| 110 native 'JSON' /// 32: compile-time error | 110 native 'JSON' /// 32: compile-time error |
| 111 {} | 111 {} |
| 112 | 112 |
| 113 class ListFactory<E> implements List<E> | 113 class ListFactory<E> implements List<E> |
| 114 native "Array" /// 33: compile-time error | 114 native "Array" /// 33: compile-time error |
| 115 {} | 115 {} |
| 116 | 116 |
| 117 interface I extends UNKNOWN; /// 34: compile-time error | 117 abstract class I implements UNKNOWN; /// 34: compile-time error |
| 118 | 118 |
| 119 class XWindow extends DOMWindow | 119 class XWindow extends DOMWindow |
| 120 hest "*Window" /// 35: compile-time error | 120 hest "*Window" /// 35: compile-time error |
| 121 {} | 121 {} |
| 122 | 122 |
| 123 class XConsole | 123 class XConsole |
| 124 hest "=(typeof console == 'undefined' ? {} : console)" /// 36: compile-time erro
r | 124 hest "=(typeof console == 'undefined' ? {} : console)" /// 36: compile-time erro
r |
| 125 {} | 125 {} |
| 126 | 126 |
| 127 class XNativeClass | 127 class XNativeClass |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 class YListFactory<E> implements List<E> | 163 class YListFactory<E> implements List<E> |
| 164 for "Array" /// 46: compile-time error | 164 for "Array" /// 46: compile-time error |
| 165 {} | 165 {} |
| 166 | 166 |
| 167 class A { | 167 class A { |
| 168 const A() | 168 const A() |
| 169 {} /// 47: compile-time error | 169 {} /// 47: compile-time error |
| 170 ; | 170 ; |
| 171 } | 171 } |
| 172 | 172 |
| 173 interface G<T> {} | 173 abstract class G<T> {} |
| 174 | 174 |
| 175 typedef <T>(); /// 48: compile-time error | 175 typedef <T>(); /// 48: compile-time error |
| 176 | 176 |
| 177 class B | 177 class B |
| 178 extends void /// 49: compile-time error | 178 extends void /// 49: compile-time error |
| 179 {} | 179 {} |
| 180 | 180 |
| 181 main() { | 181 main() { |
| 182 try { | 182 try { |
| 183 new SyntaxTest(); | 183 new SyntaxTest(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 235 |
| 236 } catch (ex) { | 236 } catch (ex) { |
| 237 // Swallowing exceptions. Any error should be a compile-time error | 237 // Swallowing exceptions. Any error should be a compile-time error |
| 238 // which kills the current isolate. | 238 // which kills the current isolate. |
| 239 } | 239 } |
| 240 } | 240 } |
| 241 | 241 |
| 242 class Bad { | 242 class Bad { |
| 243 factory Bad<Bad(String type) { return null; } /// 63: compile-time error | 243 factory Bad<Bad(String type) { return null; } /// 63: compile-time error |
| 244 } | 244 } |
| OLD | NEW |