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

Unified Diff: test/codegen/expect/language/loop_hoist_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/loop_hoist_test.js
diff --git a/test/codegen/expect/language/loop_hoist_test.js b/test/codegen/expect/language/loop_hoist_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..56fed8ffd7e83405f41fc91cec0dfc59b2d0d788
--- /dev/null
+++ b/test/codegen/expect/language/loop_hoist_test.js
@@ -0,0 +1,50 @@
+dart_library.library('language/loop_hoist_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__loop_hoist_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 loop_hoist_test = Object.create(null);
+ let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ loop_hoist_test.A = class A extends core.Object {
+ new() {
+ this.x = 0;
+ }
+ bar() {
+ for (let i = 1; i < 3; i++) {
+ this.setX(499);
+ loop_hoist_test.foo(this.x);
+ break;
+ }
+ }
+ setX(x) {
+ return this.x = core.num._check(x);
+ }
+ };
+ dart.setSignature(loop_hoist_test.A, {
+ constructors: () => ({new: dart.definiteFunctionType(loop_hoist_test.A, [])}),
+ methods: () => ({
+ bar: dart.definiteFunctionType(dart.void, []),
+ setX: dart.definiteFunctionType(dart.dynamic, [dart.dynamic])
+ })
+ });
+ loop_hoist_test.saved = null;
+ loop_hoist_test.foo = function(x) {
+ return loop_hoist_test.saved = x;
+ };
+ dart.fn(loop_hoist_test.foo, dynamicTodynamic());
+ loop_hoist_test.main = function() {
+ let a = new loop_hoist_test.A();
+ for (let i = 0; i < 1; i++) {
+ a.bar();
+ }
+ expect$.Expect.equals(499, loop_hoist_test.saved);
+ };
+ dart.fn(loop_hoist_test.main, VoidTodynamic());
+ // Exports:
+ exports.loop_hoist_test = loop_hoist_test;
+});
« no previous file with comments | « test/codegen/expect/language/loop_exchange_test.js ('k') | test/codegen/expect/language/main_not_a_function_test_01_multi.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698