| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library analyzer.test.src.summary.summary_common; | 5 library analyzer.test.src.summary.summary_common; |
| 6 | 6 |
| 7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
| 8 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/src/dart/scanner/reader.dart'; | 10 import 'package:analyzer/src/dart/scanner/reader.dart'; |
| (...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1783 operators: [ | 1783 operators: [ |
| 1784 UnlinkedConstOperation.pushInt, | 1784 UnlinkedConstOperation.pushInt, |
| 1785 UnlinkedConstOperation.pushLocalFunctionReference, | 1785 UnlinkedConstOperation.pushLocalFunctionReference, |
| 1786 UnlinkedConstOperation.invokeMethodRef | 1786 UnlinkedConstOperation.invokeMethodRef |
| 1787 ], | 1787 ], |
| 1788 ints: [ | 1788 ints: [ |
| 1789 5, | 1789 5, |
| 1790 0, | 1790 0, |
| 1791 0, | 1791 0, |
| 1792 0, | 1792 0, |
| 1793 2 | 1793 2, |
| 1794 0 |
| 1794 ], | 1795 ], |
| 1795 referenceValidators: [ | 1796 referenceValidators: [ |
| 1796 (EntityRef r) => checkTypeRef(r, null, null, 'foo', | 1797 (EntityRef r) => checkTypeRef(r, null, null, 'foo', |
| 1797 expectedKind: ReferenceKind.topLevelFunction) | 1798 expectedKind: ReferenceKind.topLevelFunction) |
| 1798 ]); | 1799 ]); |
| 1799 } | 1800 } |
| 1800 | 1801 |
| 1801 test_constExpr_functionExpression_asArgument_multiple() { | 1802 test_constExpr_functionExpression_asArgument_multiple() { |
| 1802 // Even though function expressions are not allowed in constant | 1803 // Even though function expressions are not allowed in constant |
| 1803 // declarations, they might occur due to erroneous code, so make sure they | 1804 // declarations, they might occur due to erroneous code, so make sure they |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1814 UnlinkedConstOperation.pushLocalFunctionReference, | 1815 UnlinkedConstOperation.pushLocalFunctionReference, |
| 1815 UnlinkedConstOperation.invokeMethodRef | 1816 UnlinkedConstOperation.invokeMethodRef |
| 1816 ], | 1817 ], |
| 1817 ints: [ | 1818 ints: [ |
| 1818 5, | 1819 5, |
| 1819 0, | 1820 0, |
| 1820 0, | 1821 0, |
| 1821 0, | 1822 0, |
| 1822 1, | 1823 1, |
| 1823 0, | 1824 0, |
| 1824 3 | 1825 3, |
| 1826 0 |
| 1825 ], | 1827 ], |
| 1826 referenceValidators: [ | 1828 referenceValidators: [ |
| 1827 (EntityRef r) => checkTypeRef(r, null, null, 'foo', | 1829 (EntityRef r) => checkTypeRef(r, null, null, 'foo', |
| 1828 expectedKind: ReferenceKind.topLevelFunction) | 1830 expectedKind: ReferenceKind.topLevelFunction) |
| 1829 ]); | 1831 ]); |
| 1830 } | 1832 } |
| 1831 | 1833 |
| 1832 test_constExpr_functionExpression_inConstructorInitializers() { | 1834 test_constExpr_functionExpression_inConstructorInitializers() { |
| 1833 // Even though function expressions are not allowed in constant | 1835 // Even though function expressions are not allowed in constant |
| 1834 // declarations, they might occur due to erroneous code, so make sure they | 1836 // declarations, they might occur due to erroneous code, so make sure they |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2315 test_constExpr_invokeMethodRef_identical() { | 2317 test_constExpr_invokeMethodRef_identical() { |
| 2316 UnlinkedVariable variable = | 2318 UnlinkedVariable variable = |
| 2317 serializeVariableText('const v = identical(42, null);'); | 2319 serializeVariableText('const v = identical(42, null);'); |
| 2318 _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [ | 2320 _assertUnlinkedConst(variable.initializer.bodyExpr, operators: [ |
| 2319 UnlinkedConstOperation.pushInt, | 2321 UnlinkedConstOperation.pushInt, |
| 2320 UnlinkedConstOperation.pushNull, | 2322 UnlinkedConstOperation.pushNull, |
| 2321 UnlinkedConstOperation.invokeMethodRef | 2323 UnlinkedConstOperation.invokeMethodRef |
| 2322 ], ints: [ | 2324 ], ints: [ |
| 2323 42, | 2325 42, |
| 2324 0, | 2326 0, |
| 2325 2 | 2327 2, |
| 2328 0 |
| 2326 ], referenceValidators: [ | 2329 ], referenceValidators: [ |
| 2327 (EntityRef r) { | 2330 (EntityRef r) { |
| 2328 checkTypeRef(r, 'dart:core', 'dart:core', 'identical', | 2331 checkTypeRef(r, 'dart:core', 'dart:core', 'identical', |
| 2329 expectedKind: ReferenceKind.topLevelFunction); | 2332 expectedKind: ReferenceKind.topLevelFunction); |
| 2330 } | 2333 } |
| 2331 ]); | 2334 ]); |
| 2332 } | 2335 } |
| 2333 | 2336 |
| 2334 test_constExpr_length_classConstField() { | 2337 test_constExpr_length_classConstField() { |
| 2335 UnlinkedVariable variable = serializeVariableText(''' | 2338 UnlinkedVariable variable = serializeVariableText(''' |
| (...skipping 4538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6874 // a | 6877 // a |
| 6875 UnlinkedConstOperation.cascadeSectionEnd, | 6878 UnlinkedConstOperation.cascadeSectionEnd, |
| 6876 // ..m(6) | 6879 // ..m(6) |
| 6877 UnlinkedConstOperation.cascadeSectionBegin, | 6880 UnlinkedConstOperation.cascadeSectionBegin, |
| 6878 UnlinkedConstOperation.pushInt, | 6881 UnlinkedConstOperation.pushInt, |
| 6879 UnlinkedConstOperation.invokeMethod, | 6882 UnlinkedConstOperation.invokeMethod, |
| 6880 // a | 6883 // a |
| 6881 UnlinkedConstOperation.cascadeSectionEnd, | 6884 UnlinkedConstOperation.cascadeSectionEnd, |
| 6882 ], | 6885 ], |
| 6883 ints: [ | 6886 ints: [ |
| 6884 5, 0, 1, // m(5) | 6887 5, 0, 1, 0, // m(5) |
| 6885 0, 0, // abs() | 6888 0, 0, 0, // abs() |
| 6886 6, 0, 1, // m(5) | 6889 6, 0, 1, 0, // m(5) |
| 6887 ], | 6890 ], |
| 6888 strings: [ | 6891 strings: [ |
| 6889 'm', | 6892 'm', |
| 6890 'abs', | 6893 'abs', |
| 6891 'm', | 6894 'm', |
| 6892 ], | 6895 ], |
| 6893 referenceValidators: [ | 6896 referenceValidators: [ |
| 6894 (EntityRef r) => checkTypeRef(r, null, null, 'a', | 6897 (EntityRef r) => checkTypeRef(r, null, null, 'a', |
| 6895 expectedKind: ReferenceKind.topLevelPropertyAccessor), | 6898 expectedKind: ReferenceKind.topLevelPropertyAccessor), |
| 6896 ]); | 6899 ]); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6970 operators: [ | 6973 operators: [ |
| 6971 UnlinkedConstOperation.pushInt, | 6974 UnlinkedConstOperation.pushInt, |
| 6972 UnlinkedConstOperation.pushLocalFunctionReference, | 6975 UnlinkedConstOperation.pushLocalFunctionReference, |
| 6973 UnlinkedConstOperation.invokeMethodRef | 6976 UnlinkedConstOperation.invokeMethodRef |
| 6974 ], | 6977 ], |
| 6975 ints: [ | 6978 ints: [ |
| 6976 5, | 6979 5, |
| 6977 0, | 6980 0, |
| 6978 0, | 6981 0, |
| 6979 0, | 6982 0, |
| 6980 2 | 6983 2, |
| 6984 0 |
| 6981 ], | 6985 ], |
| 6982 referenceValidators: [ | 6986 referenceValidators: [ |
| 6983 (EntityRef r) => checkTypeRef(r, null, null, 'foo', | 6987 (EntityRef r) => checkTypeRef(r, null, null, 'foo', |
| 6984 expectedKind: ReferenceKind.topLevelFunction) | 6988 expectedKind: ReferenceKind.topLevelFunction) |
| 6985 ]); | 6989 ]); |
| 6986 } | 6990 } |
| 6987 | 6991 |
| 6988 test_expr_functionExpression_asArgument_multiple() { | 6992 test_expr_functionExpression_asArgument_multiple() { |
| 6989 if (skipNonConstInitializers) { | 6993 if (skipNonConstInitializers) { |
| 6990 return; | 6994 return; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 7001 UnlinkedConstOperation.pushLocalFunctionReference, | 7005 UnlinkedConstOperation.pushLocalFunctionReference, |
| 7002 UnlinkedConstOperation.invokeMethodRef | 7006 UnlinkedConstOperation.invokeMethodRef |
| 7003 ], | 7007 ], |
| 7004 ints: [ | 7008 ints: [ |
| 7005 5, | 7009 5, |
| 7006 0, | 7010 0, |
| 7007 0, | 7011 0, |
| 7008 0, | 7012 0, |
| 7009 1, | 7013 1, |
| 7010 0, | 7014 0, |
| 7011 3 | 7015 3, |
| 7016 0 |
| 7012 ], | 7017 ], |
| 7013 referenceValidators: [ | 7018 referenceValidators: [ |
| 7014 (EntityRef r) => checkTypeRef(r, null, null, 'foo', | 7019 (EntityRef r) => checkTypeRef(r, null, null, 'foo', |
| 7015 expectedKind: ReferenceKind.topLevelFunction) | 7020 expectedKind: ReferenceKind.topLevelFunction) |
| 7016 ]); | 7021 ]); |
| 7017 } | 7022 } |
| 7018 | 7023 |
| 7019 test_expr_functionExpression_withBlockBody() { | 7024 test_expr_functionExpression_withBlockBody() { |
| 7020 if (skipNonConstInitializers) { | 7025 if (skipNonConstInitializers) { |
| 7021 return; | 7026 return; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7111 operators: [ | 7116 operators: [ |
| 7112 UnlinkedConstOperation.pushParameter, | 7117 UnlinkedConstOperation.pushParameter, |
| 7113 UnlinkedConstOperation.invokeMethod | 7118 UnlinkedConstOperation.invokeMethod |
| 7114 ], | 7119 ], |
| 7115 strings: [ | 7120 strings: [ |
| 7116 'x', | 7121 'x', |
| 7117 'f' | 7122 'f' |
| 7118 ], | 7123 ], |
| 7119 ints: [ | 7124 ints: [ |
| 7120 0, | 7125 0, |
| 7126 0, |
| 7121 0 | 7127 0 |
| 7122 ]); | 7128 ]); |
| 7123 } | 7129 } |
| 7124 | 7130 |
| 7125 test_expr_inClosure_refersToParam_methodCall_prefixed() { | 7131 test_expr_inClosure_refersToParam_methodCall_prefixed() { |
| 7126 if (skipNonConstInitializers) { | 7132 if (skipNonConstInitializers) { |
| 7127 return; | 7133 return; |
| 7128 } | 7134 } |
| 7129 UnlinkedVariable variable = | 7135 UnlinkedVariable variable = |
| 7130 serializeVariableText('var v = (x) => x.y.f();'); | 7136 serializeVariableText('var v = (x) => x.y.f();'); |
| 7131 _assertUnlinkedConst(variable.initializer.localFunctions[0].bodyExpr, | 7137 _assertUnlinkedConst(variable.initializer.localFunctions[0].bodyExpr, |
| 7132 isValidConst: false, | 7138 isValidConst: false, |
| 7133 operators: [ | 7139 operators: [ |
| 7134 UnlinkedConstOperation.pushParameter, | 7140 UnlinkedConstOperation.pushParameter, |
| 7135 UnlinkedConstOperation.extractProperty, | 7141 UnlinkedConstOperation.extractProperty, |
| 7136 UnlinkedConstOperation.invokeMethod | 7142 UnlinkedConstOperation.invokeMethod |
| 7137 ], | 7143 ], |
| 7138 strings: [ | 7144 strings: [ |
| 7139 'x', | 7145 'x', |
| 7140 'y', | 7146 'y', |
| 7141 'f' | 7147 'f' |
| 7142 ], | 7148 ], |
| 7143 ints: [ | 7149 ints: [ |
| 7144 0, | 7150 0, |
| 7151 0, |
| 7145 0 | 7152 0 |
| 7146 ]); | 7153 ]); |
| 7147 } | 7154 } |
| 7148 | 7155 |
| 7149 test_expr_inClosure_refersToParam_outOfScope() { | 7156 test_expr_inClosure_refersToParam_outOfScope() { |
| 7150 if (skipNonConstInitializers) { | 7157 if (skipNonConstInitializers) { |
| 7151 return; | 7158 return; |
| 7152 } | 7159 } |
| 7153 UnlinkedVariable variable = | 7160 UnlinkedVariable variable = |
| 7154 serializeVariableText('var x; var v = (b) => (b ? (x) => x : x);'); | 7161 serializeVariableText('var x; var v = (b) => (b ? (x) => x : x);'); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7272 UnlinkedConstOperation.pushInt, | 7279 UnlinkedConstOperation.pushInt, |
| 7273 UnlinkedConstOperation.invokeMethod, | 7280 UnlinkedConstOperation.invokeMethod, |
| 7274 ], | 7281 ], |
| 7275 ints: [ | 7282 ints: [ |
| 7276 0, | 7283 0, |
| 7277 0, | 7284 0, |
| 7278 1, | 7285 1, |
| 7279 2, | 7286 2, |
| 7280 3, | 7287 3, |
| 7281 2, | 7288 2, |
| 7282 1 | 7289 1, |
| 7290 0 |
| 7283 ], | 7291 ], |
| 7284 strings: [ | 7292 strings: [ |
| 7285 'b', | 7293 'b', |
| 7286 'c', | 7294 'c', |
| 7287 'm' | 7295 'm' |
| 7288 ], | 7296 ], |
| 7289 referenceValidators: [ | 7297 referenceValidators: [ |
| 7290 (EntityRef r) => checkTypeRef(r, null, null, 'C', | 7298 (EntityRef r) => checkTypeRef(r, null, null, 'C', |
| 7291 expectedKind: ReferenceKind.classOrEnum) | 7299 expectedKind: ReferenceKind.classOrEnum) |
| 7292 ]); | 7300 ]); |
| 7293 } | 7301 } |
| 7294 | 7302 |
| 7303 test_expr_invokeMethod_withTypeParameters() { |
| 7304 if (skipNonConstInitializers) { |
| 7305 return; |
| 7306 } |
| 7307 UnlinkedVariable variable = serializeVariableText(''' |
| 7308 class C { |
| 7309 f<T, U>() => null; |
| 7310 } |
| 7311 final v = new C().f<int, String>(); |
| 7312 '''); |
| 7313 _assertUnlinkedConst(variable.initializer.bodyExpr, |
| 7314 isValidConst: false, |
| 7315 operators: [ |
| 7316 UnlinkedConstOperation.invokeConstructor, |
| 7317 UnlinkedConstOperation.invokeMethod |
| 7318 ], |
| 7319 ints: [ |
| 7320 0, |
| 7321 0, |
| 7322 0, |
| 7323 0, |
| 7324 2 |
| 7325 ], |
| 7326 strings: [ |
| 7327 'f' |
| 7328 ], |
| 7329 referenceValidators: [ |
| 7330 (EntityRef r) => checkTypeRef(r, null, null, 'C'), |
| 7331 (EntityRef r) => checkTypeRef(r, 'dart:core', 'dart:core', 'int'), |
| 7332 (EntityRef r) => checkTypeRef(r, 'dart:core', 'dart:core', 'String') |
| 7333 ]); |
| 7334 } |
| 7335 |
| 7295 test_expr_invokeMethodRef_instance() { | 7336 test_expr_invokeMethodRef_instance() { |
| 7296 if (skipNonConstInitializers) { | 7337 if (skipNonConstInitializers) { |
| 7297 return; | 7338 return; |
| 7298 } | 7339 } |
| 7299 UnlinkedVariable variable = serializeVariableText(''' | 7340 UnlinkedVariable variable = serializeVariableText(''' |
| 7300 class A { | 7341 class A { |
| 7301 B b; | 7342 B b; |
| 7302 } | 7343 } |
| 7303 class B { | 7344 class B { |
| 7304 C c; | 7345 C c; |
| 7305 } | 7346 } |
| 7306 class C { | 7347 class C { |
| 7307 int m(int a, int b) => a + b; | 7348 int m(int a, int b) => a + b; |
| 7308 } | 7349 } |
| 7309 A a = new A(); | 7350 A a = new A(); |
| 7310 final v = a.b.c.m(10, 20); | 7351 final v = a.b.c.m(10, 20); |
| 7311 '''); | 7352 '''); |
| 7312 _assertUnlinkedConst(variable.initializer.bodyExpr, | 7353 _assertUnlinkedConst(variable.initializer.bodyExpr, |
| 7313 isValidConst: false, | 7354 isValidConst: false, |
| 7314 operators: [ | 7355 operators: [ |
| 7315 UnlinkedConstOperation.pushInt, | 7356 UnlinkedConstOperation.pushInt, |
| 7316 UnlinkedConstOperation.pushInt, | 7357 UnlinkedConstOperation.pushInt, |
| 7317 UnlinkedConstOperation.invokeMethodRef, | 7358 UnlinkedConstOperation.invokeMethodRef, |
| 7318 ], | 7359 ], |
| 7319 ints: [ | 7360 ints: [ |
| 7320 10, | 7361 10, |
| 7321 20, | 7362 20, |
| 7322 0, | 7363 0, |
| 7323 2 | 7364 2, |
| 7365 0 |
| 7324 ], | 7366 ], |
| 7325 strings: [], | 7367 strings: [], |
| 7326 referenceValidators: [ | 7368 referenceValidators: [ |
| 7327 (EntityRef r) => checkTypeRef(r, null, null, 'm', | 7369 (EntityRef r) => checkTypeRef(r, null, null, 'm', |
| 7328 expectedKind: ReferenceKind.unresolved, | 7370 expectedKind: ReferenceKind.unresolved, |
| 7329 prefixExpectations: [ | 7371 prefixExpectations: [ |
| 7330 new _PrefixExpectation(ReferenceKind.unresolved, 'c'), | 7372 new _PrefixExpectation(ReferenceKind.unresolved, 'c'), |
| 7331 new _PrefixExpectation(ReferenceKind.unresolved, 'b'), | 7373 new _PrefixExpectation(ReferenceKind.unresolved, 'b'), |
| 7332 new _PrefixExpectation( | 7374 new _PrefixExpectation( |
| 7333 ReferenceKind.topLevelPropertyAccessor, 'a') | 7375 ReferenceKind.topLevelPropertyAccessor, 'a') |
| (...skipping 16 matching lines...) Expand all Loading... |
| 7350 import 'a.dart' as p; | 7392 import 'a.dart' as p; |
| 7351 final v = p.C.m(); | 7393 final v = p.C.m(); |
| 7352 '''); | 7394 '''); |
| 7353 _assertUnlinkedConst(variable.initializer.bodyExpr, | 7395 _assertUnlinkedConst(variable.initializer.bodyExpr, |
| 7354 isValidConst: false, | 7396 isValidConst: false, |
| 7355 operators: [ | 7397 operators: [ |
| 7356 UnlinkedConstOperation.invokeMethodRef, | 7398 UnlinkedConstOperation.invokeMethodRef, |
| 7357 ], | 7399 ], |
| 7358 ints: [ | 7400 ints: [ |
| 7359 0, | 7401 0, |
| 7402 0, |
| 7360 0 | 7403 0 |
| 7361 ], | 7404 ], |
| 7362 strings: [], | 7405 strings: [], |
| 7363 referenceValidators: [ | 7406 referenceValidators: [ |
| 7364 (EntityRef r) => checkTypeRef(r, null, null, 'm', | 7407 (EntityRef r) => checkTypeRef(r, null, null, 'm', |
| 7365 expectedKind: ReferenceKind.method, | 7408 expectedKind: ReferenceKind.method, |
| 7366 prefixExpectations: [ | 7409 prefixExpectations: [ |
| 7367 new _PrefixExpectation(ReferenceKind.classOrEnum, 'C', | 7410 new _PrefixExpectation(ReferenceKind.classOrEnum, 'C', |
| 7368 absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'), | 7411 absoluteUri: absUri('/a.dart'), relativeUri: 'a.dart'), |
| 7369 new _PrefixExpectation(ReferenceKind.prefix, 'p') | 7412 new _PrefixExpectation(ReferenceKind.prefix, 'p') |
| (...skipping 11 matching lines...) Expand all Loading... |
| 7381 final v = f(u); | 7424 final v = f(u); |
| 7382 '''); | 7425 '''); |
| 7383 _assertUnlinkedConst(variable.initializer.bodyExpr, | 7426 _assertUnlinkedConst(variable.initializer.bodyExpr, |
| 7384 isValidConst: false, | 7427 isValidConst: false, |
| 7385 operators: [ | 7428 operators: [ |
| 7386 UnlinkedConstOperation.pushReference, | 7429 UnlinkedConstOperation.pushReference, |
| 7387 UnlinkedConstOperation.invokeMethodRef | 7430 UnlinkedConstOperation.invokeMethodRef |
| 7388 ], | 7431 ], |
| 7389 ints: [ | 7432 ints: [ |
| 7390 0, | 7433 0, |
| 7391 1 | 7434 1, |
| 7435 0 |
| 7392 ], | 7436 ], |
| 7393 referenceValidators: [ | 7437 referenceValidators: [ |
| 7394 (EntityRef r) => checkTypeRef(r, null, null, 'u', | 7438 (EntityRef r) => checkTypeRef(r, null, null, 'u', |
| 7395 expectedKind: ReferenceKind.topLevelPropertyAccessor), | 7439 expectedKind: ReferenceKind.topLevelPropertyAccessor), |
| 7396 (EntityRef r) => checkTypeRef(r, null, null, 'f', | 7440 (EntityRef r) => checkTypeRef(r, null, null, 'f', |
| 7397 expectedKind: ReferenceKind.topLevelFunction) | 7441 expectedKind: ReferenceKind.topLevelFunction) |
| 7398 ]); | 7442 ]); |
| 7399 } | 7443 } |
| 7400 | 7444 |
| 7445 test_expr_invokeMethodRef_withTypeParameters() { |
| 7446 if (skipNonConstInitializers) { |
| 7447 return; |
| 7448 } |
| 7449 UnlinkedVariable variable = serializeVariableText(''' |
| 7450 f<T, U>() => null; |
| 7451 final v = f<int, String>(); |
| 7452 '''); |
| 7453 _assertUnlinkedConst(variable.initializer.bodyExpr, |
| 7454 isValidConst: false, |
| 7455 operators: [ |
| 7456 UnlinkedConstOperation.invokeMethodRef |
| 7457 ], |
| 7458 ints: [ |
| 7459 0, |
| 7460 0, |
| 7461 2 |
| 7462 ], |
| 7463 referenceValidators: [ |
| 7464 (EntityRef r) => checkTypeRef(r, null, null, 'f', |
| 7465 expectedKind: ReferenceKind.topLevelFunction, |
| 7466 numTypeParameters: 2), |
| 7467 (EntityRef r) => checkTypeRef(r, 'dart:core', 'dart:core', 'int'), |
| 7468 (EntityRef r) => checkTypeRef(r, 'dart:core', 'dart:core', 'String') |
| 7469 ]); |
| 7470 } |
| 7471 |
| 7401 test_expr_throwException() { | 7472 test_expr_throwException() { |
| 7402 if (skipNonConstInitializers) { | 7473 if (skipNonConstInitializers) { |
| 7403 return; | 7474 return; |
| 7404 } | 7475 } |
| 7405 UnlinkedVariable variable = serializeVariableText(''' | 7476 UnlinkedVariable variable = serializeVariableText(''' |
| 7406 final v = throw 1 + 2; | 7477 final v = throw 1 + 2; |
| 7407 '''); | 7478 '''); |
| 7408 _assertUnlinkedConst(variable.initializer.bodyExpr, | 7479 _assertUnlinkedConst(variable.initializer.bodyExpr, |
| 7409 isValidConst: false, | 7480 isValidConst: false, |
| 7410 operators: [ | 7481 operators: [ |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7517 _assertUnlinkedConst(variable.initializer.bodyExpr, | 7588 _assertUnlinkedConst(variable.initializer.bodyExpr, |
| 7518 isValidConst: false, | 7589 isValidConst: false, |
| 7519 operators: [ | 7590 operators: [ |
| 7520 UnlinkedConstOperation.pushInt, | 7591 UnlinkedConstOperation.pushInt, |
| 7521 UnlinkedConstOperation.invokeMethodRef, | 7592 UnlinkedConstOperation.invokeMethodRef, |
| 7522 UnlinkedConstOperation.add, | 7593 UnlinkedConstOperation.add, |
| 7523 ], | 7594 ], |
| 7524 ints: [ | 7595 ints: [ |
| 7525 1, | 7596 1, |
| 7526 0, | 7597 0, |
| 7598 0, |
| 7527 0 | 7599 0 |
| 7528 ], | 7600 ], |
| 7529 strings: [], | 7601 strings: [], |
| 7530 referenceValidators: [ | 7602 referenceValidators: [ |
| 7531 (EntityRef r) => checkTypeRef(r, null, null, 'm', | 7603 (EntityRef r) => checkTypeRef(r, null, null, 'm', |
| 7532 expectedKind: ReferenceKind.method, | 7604 expectedKind: ReferenceKind.method, |
| 7533 prefixExpectations: [ | 7605 prefixExpectations: [ |
| 7534 new _PrefixExpectation(ReferenceKind.classOrEnum, 'C') | 7606 new _PrefixExpectation(ReferenceKind.classOrEnum, 'C') |
| 7535 ]) | 7607 ]) |
| 7536 ]); | 7608 ]); |
| (...skipping 2917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10454 class _PrefixExpectation { | 10526 class _PrefixExpectation { |
| 10455 final ReferenceKind kind; | 10527 final ReferenceKind kind; |
| 10456 final String name; | 10528 final String name; |
| 10457 final String absoluteUri; | 10529 final String absoluteUri; |
| 10458 final String relativeUri; | 10530 final String relativeUri; |
| 10459 final int numTypeParameters; | 10531 final int numTypeParameters; |
| 10460 | 10532 |
| 10461 _PrefixExpectation(this.kind, this.name, | 10533 _PrefixExpectation(this.kind, this.name, |
| 10462 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); | 10534 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); |
| 10463 } | 10535 } |
| OLD | NEW |