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

Unified Diff: test/codegen/expect/language/implicit_closure_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/implicit_closure_test.js
diff --git a/test/codegen/expect/language/implicit_closure_test.js b/test/codegen/expect/language/implicit_closure_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..054a2efabcae733160668fa32269303d7786e8a1
--- /dev/null
+++ b/test/codegen/expect/language/implicit_closure_test.js
@@ -0,0 +1,58 @@
+dart_library.library('language/implicit_closure_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__implicit_closure_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 implicit_closure_test = Object.create(null);
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let VoidToint = () => (VoidToint = dart.constFn(dart.definiteFunctionType(core.int, [])))();
+ implicit_closure_test.First = class First extends core.Object {
+ new(i) {
+ this.i = i;
+ this.b = null;
+ }
+ foo() {
+ return this.i;
+ }
+ foo1() {
+ const local = (function() {
+ return this.i;
+ }).bind(this);
+ dart.fn(local, VoidTodynamic());
+ return local;
+ }
+ };
+ dart.setSignature(implicit_closure_test.First, {
+ constructors: () => ({new: dart.definiteFunctionType(implicit_closure_test.First, [core.int])}),
+ methods: () => ({
+ foo: dart.definiteFunctionType(core.int, []),
+ foo1: dart.definiteFunctionType(core.Function, [])
+ })
+ });
+ implicit_closure_test.ImplicitClosureTest = class ImplicitClosureTest extends core.Object {
+ static testMain() {
+ let obj = new implicit_closure_test.First(20);
+ let func = dart.fn(() => obj.i, VoidToint());
+ obj.b = func;
+ expect$.Expect.equals(20, dart.dsend(obj, 'b'));
+ let ib1 = obj.foo1();
+ expect$.Expect.equals(obj.i, dart.dcall(ib1));
+ let ib = dart.bind(obj, 'foo');
+ expect$.Expect.equals(obj.i, ib());
+ }
+ };
+ dart.setSignature(implicit_closure_test.ImplicitClosureTest, {
+ statics: () => ({testMain: dart.definiteFunctionType(dart.void, [])}),
+ names: ['testMain']
+ });
+ implicit_closure_test.main = function() {
+ implicit_closure_test.ImplicitClosureTest.testMain();
+ };
+ dart.fn(implicit_closure_test.main, VoidTodynamic());
+ // Exports:
+ exports.implicit_closure_test = implicit_closure_test;
+});
« no previous file with comments | « test/codegen/expect/language/implicit_closure2_test.js ('k') | test/codegen/expect/language/implicit_scope_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698