| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, the Dart project authors. | 2 * Copyright (c) 2013, the Dart project authors. |
| 3 * | 3 * |
| 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except | 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u
se this file except |
| 5 * in compliance with the License. You may obtain a copy of the License at | 5 * in compliance with the License. You may obtain a copy of the License at |
| 6 * | 6 * |
| 7 * http://www.eclipse.org/legal/epl-v10.html | 7 * http://www.eclipse.org/legal/epl-v10.html |
| 8 * | 8 * |
| 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License | 9 * Unless required by applicable law or agreed to in writing, software distribut
ed under the License |
| 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express | 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K
IND, either express |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 " get hashCode => 0;", | 252 " get hashCode => 0;", |
| 253 "}")); | 253 "}")); |
| 254 resolve(source); | 254 resolve(source); |
| 255 assertNoErrors(source); | 255 assertNoErrors(source); |
| 256 verify(source); | 256 verify(source); |
| 257 } | 257 } |
| 258 | 258 |
| 259 public void test_proxy_annotation_prefixed() throws Exception { | 259 public void test_proxy_annotation_prefixed() throws Exception { |
| 260 Source source = addSource(createSource(// | 260 Source source = addSource(createSource(// |
| 261 "library L;", | 261 "library L;", |
| 262 "import 'meta.dart';", | |
| 263 "@proxy", | 262 "@proxy", |
| 264 "class A {}", | 263 "class A {}", |
| 265 "f(var a) {", | 264 "f(var a) {", |
| 266 " a = new A();", | 265 " a = new A();", |
| 267 " a.m();", | 266 " a.m();", |
| 268 " var x = a.g;", | 267 " var x = a.g;", |
| 269 " a.s = 1;", | 268 " a.s = 1;", |
| 270 " var y = a + a;", | 269 " var y = a + a;", |
| 271 " a++;", | 270 " a++;", |
| 272 " ++a;", | 271 " ++a;", |
| 273 "}")); | 272 "}")); |
| 274 addSource("/meta.dart", createSource(// | |
| 275 "library meta;", | |
| 276 "const proxy = const _Proxy();", | |
| 277 "class _Proxy { const _Proxy(); }")); | |
| 278 resolve(source); | 273 resolve(source); |
| 279 assertNoErrors(source); | 274 assertNoErrors(source); |
| 280 } | 275 } |
| 281 | 276 |
| 282 public void test_proxy_annotation_prefixed2() throws Exception { | 277 public void test_proxy_annotation_prefixed2() throws Exception { |
| 283 Source source = addSource(createSource(// | 278 Source source = addSource(createSource(// |
| 284 "library L;", | 279 "library L;", |
| 285 "import 'meta.dart';", | |
| 286 "@proxy", | 280 "@proxy", |
| 287 "class A {}", | 281 "class A {}", |
| 288 "class B {", | 282 "class B {", |
| 289 " f(var a) {", | 283 " f(var a) {", |
| 290 " a = new A();", | 284 " a = new A();", |
| 291 " a.m();", | 285 " a.m();", |
| 292 " var x = a.g;", | 286 " var x = a.g;", |
| 293 " a.s = 1;", | 287 " a.s = 1;", |
| 294 " var y = a + a;", | 288 " var y = a + a;", |
| 295 " a++;", | 289 " a++;", |
| 296 " ++a;", | 290 " ++a;", |
| 297 " }", | 291 " }", |
| 298 "}")); | 292 "}")); |
| 299 addSource("/meta.dart", createSource(// | |
| 300 "library meta;", | |
| 301 "const proxy = const _Proxy();", | |
| 302 "class _Proxy { const _Proxy(); }")); | |
| 303 resolve(source); | 293 resolve(source); |
| 304 assertNoErrors(source); | 294 assertNoErrors(source); |
| 305 } | 295 } |
| 306 | 296 |
| 307 public void test_proxy_annotation_prefixed3() throws Exception { | 297 public void test_proxy_annotation_prefixed3() throws Exception { |
| 308 Source source = addSource(createSource(// | 298 Source source = addSource(createSource(// |
| 309 "library L;", | 299 "library L;", |
| 310 "import 'meta.dart';", | |
| 311 "class B {", | 300 "class B {", |
| 312 " f(var a) {", | 301 " f(var a) {", |
| 313 " a = new A();", | 302 " a = new A();", |
| 314 " a.m();", | 303 " a.m();", |
| 315 " var x = a.g;", | 304 " var x = a.g;", |
| 316 " a.s = 1;", | 305 " a.s = 1;", |
| 317 " var y = a + a;", | 306 " var y = a + a;", |
| 318 " a++;", | 307 " a++;", |
| 319 " ++a;", | 308 " ++a;", |
| 320 " }", | 309 " }", |
| 321 "}", | 310 "}", |
| 322 "@proxy", | 311 "@proxy", |
| 323 "class A {}")); | 312 "class A {}")); |
| 324 addSource("/meta.dart", createSource(// | |
| 325 "library meta;", | |
| 326 "const proxy = const _Proxy();", | |
| 327 "class _Proxy { const _Proxy(); }")); | |
| 328 resolve(source); | 313 resolve(source); |
| 329 assertNoErrors(source); | 314 assertNoErrors(source); |
| 330 } | 315 } |
| 331 | 316 |
| 332 public void test_undefinedGetter_inSubtype() throws Exception { | 317 public void test_undefinedGetter_inSubtype() throws Exception { |
| 333 Source source = addSource(createSource(// | 318 Source source = addSource(createSource(// |
| 334 "class A {}", | 319 "class A {}", |
| 335 "class B extends A {", | 320 "class B extends A {", |
| 336 " get b => 0;", | 321 " get b => 0;", |
| 337 "}", | 322 "}", |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 "}")); | 597 "}")); |
| 613 addSource("/lib1.dart", createSource(// | 598 addSource("/lib1.dart", createSource(// |
| 614 "library lib1;", | 599 "library lib1;", |
| 615 "class One {}", | 600 "class One {}", |
| 616 "topLevelFunction() {}")); | 601 "topLevelFunction() {}")); |
| 617 resolve(source); | 602 resolve(source); |
| 618 assertNoErrors(source); | 603 assertNoErrors(source); |
| 619 verify(source); | 604 verify(source); |
| 620 } | 605 } |
| 621 } | 606 } |
| OLD | NEW |