| 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 package com.google.dart.compiler.end2end.inc; | 4 package com.google.dart.compiler.end2end.inc; |
| 5 | 5 |
| 6 import com.google.common.collect.Lists; | 6 import com.google.common.collect.Lists; |
| 7 import com.google.common.collect.Maps; | 7 import com.google.common.collect.Maps; |
| 8 import com.google.common.collect.Sets; | 8 import com.google.common.collect.Sets; |
| 9 import com.google.dart.compiler.CompilerTestCase; | 9 import com.google.dart.compiler.CompilerTestCase; |
| 10 import com.google.dart.compiler.DartCompilationError; | 10 import com.google.dart.compiler.DartCompilationError; |
| (...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1576 "library A;", | 1576 "library A;", |
| 1577 "import 'dart-ext:test_extension';", | 1577 "import 'dart-ext:test_extension';", |
| 1578 "class A {", | 1578 "class A {", |
| 1579 " static int ifNull(a, b) native 'TestExtension_IfNull';", | 1579 " static int ifNull(a, b) native 'TestExtension_IfNull';", |
| 1580 "}", | 1580 "}", |
| 1581 "")); | 1581 "")); |
| 1582 // do compile, no errors expected | 1582 // do compile, no errors expected |
| 1583 compile(); | 1583 compile(); |
| 1584 assertErrors(errors); | 1584 assertErrors(errors); |
| 1585 } | 1585 } |
| 1586 | |
| 1587 /** | |
| 1588 * Internals of Dart use "dart-ext:" import scheme, and these libraries are al
lowed to use | |
| 1589 * "native". Obsolete import syntax. | |
| 1590 */ | |
| 1591 public void test_useNative_withDartExt_obsolete() throws Exception { | |
| 1592 appSource.setContent( | |
| 1593 APP, | |
| 1594 makeCode( | |
| 1595 "// filler filler filler filler filler filler filler filler filler f
iller filler", | |
| 1596 "#library('A');", | |
| 1597 "#import('dart-ext:test_extension');", | |
| 1598 "class A {", | |
| 1599 " static int ifNull(a, b) native 'TestExtension_IfNull';", | |
| 1600 "}", | |
| 1601 "")); | |
| 1602 // do compile, no errors expected | |
| 1603 compile(); | |
| 1604 assertErrors(errors); | |
| 1605 } | |
| 1606 | 1586 |
| 1607 /** | 1587 /** |
| 1608 * <p> | 1588 * <p> |
| 1609 * http://code.google.com/p/dart/issues/detail?id=6077 | 1589 * http://code.google.com/p/dart/issues/detail?id=6077 |
| 1610 */ | 1590 */ |
| 1611 public void test_dartMirrors_notFullyImplemented() throws Exception { | 1591 public void test_dartMirrors_notFullyImplemented() throws Exception { |
| 1612 appSource.setContent( | 1592 appSource.setContent( |
| 1613 APP, | 1593 APP, |
| 1614 makeCode("// filler filler filler filler filler filler filler filler fil
ler filler filler", | 1594 makeCode("// filler filler filler filler filler filler filler filler fil
ler filler filler", |
| 1615 "import 'dart:mirrors';")); | 1595 "import 'dart:mirrors';")); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1662 private void didWrite(String sourceName, String extension) { | 1642 private void didWrite(String sourceName, String extension) { |
| 1663 String spec = sourceName + "/" + extension; | 1643 String spec = sourceName + "/" + extension; |
| 1664 assertTrue("Expected write: " + spec, provider.writes.contains(spec)); | 1644 assertTrue("Expected write: " + spec, provider.writes.contains(spec)); |
| 1665 } | 1645 } |
| 1666 | 1646 |
| 1667 private void didNotWrite(String sourceName, String extension) { | 1647 private void didNotWrite(String sourceName, String extension) { |
| 1668 String spec = sourceName + "/" + extension; | 1648 String spec = sourceName + "/" + extension; |
| 1669 assertFalse("Didn't expect write: " + spec, provider.writes.contains(spec)); | 1649 assertFalse("Didn't expect write: " + spec, provider.writes.contains(spec)); |
| 1670 } | 1650 } |
| 1671 } | 1651 } |
| OLD | NEW |