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

Unified Diff: test/codegen/expect/language/type_propagation_assert_assignable_test.js

Issue 2128353002: Check in codegen test expectations. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 5 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: test/codegen/expect/language/type_propagation_assert_assignable_test.js
diff --git a/test/codegen/expect/language/type_propagation_assert_assignable_test.js b/test/codegen/expect/language/type_propagation_assert_assignable_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..a486d614c0daebb48ad49fd6bb932e084d7f271e
--- /dev/null
+++ b/test/codegen/expect/language/type_propagation_assert_assignable_test.js
@@ -0,0 +1,63 @@
+dart_library.library('language/type_propagation_assert_assignable_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__type_propagation_assert_assignable_test(exports, dart_sdk, expect) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const type_propagation_assert_assignable_test = Object.create(null);
+ let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ const _b = Symbol('_b');
+ type_propagation_assert_assignable_test.A = class A extends core.Object {
+ b() {
+ try {
+ return this[_b];
+ } catch (e) {
+ }
+
+ }
+ new(p, b) {
+ this.p = p;
+ this[_b] = b;
+ }
+ };
+ dart.setSignature(type_propagation_assert_assignable_test.A, {
+ constructors: () => ({new: dart.definiteFunctionType(type_propagation_assert_assignable_test.A, [dart.dynamic, dart.dynamic])}),
+ methods: () => ({b: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ type_propagation_assert_assignable_test.B = class B extends type_propagation_assert_assignable_test.A {
+ new(p, b) {
+ super.new(p, b);
+ }
+ };
+ dart.setSignature(type_propagation_assert_assignable_test.B, {
+ constructors: () => ({new: dart.definiteFunctionType(type_propagation_assert_assignable_test.B, [dart.dynamic, dart.dynamic])})
+ });
+ type_propagation_assert_assignable_test.bar = function(v) {
+ for (let x = v; x != null; x = dart.dload(x, 'p')) {
+ if (dart.test(dart.dsend(x, 'b'))) {
+ return x;
+ }
+ }
+ return null;
+ };
+ dart.fn(type_propagation_assert_assignable_test.bar, dynamicTodynamic());
+ type_propagation_assert_assignable_test.foo = function(v) {
+ let x = type_propagation_assert_assignable_test.A._check(type_propagation_assert_assignable_test.bar(v));
+ return x != null;
+ };
+ dart.fn(type_propagation_assert_assignable_test.foo, dynamicTodynamic());
+ type_propagation_assert_assignable_test.main = function() {
+ let a = new type_propagation_assert_assignable_test.A(new type_propagation_assert_assignable_test.B(new type_propagation_assert_assignable_test.A("haha", true), false), false);
+ for (let i = 0; i < 20; i++) {
+ expect$.Expect.isTrue(type_propagation_assert_assignable_test.foo(a));
+ }
+ expect$.Expect.isTrue(type_propagation_assert_assignable_test.foo(a));
+ };
+ dart.fn(type_propagation_assert_assignable_test.main, VoidTodynamic());
+ // Exports:
+ exports.type_propagation_assert_assignable_test = type_propagation_assert_assignable_test;
+});

Powered by Google App Engine
This is Rietveld 408576698