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

Side by Side Diff: test/codegen/expect/language/named_parameters_passing_zero_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 unified diff | Download patch
OLDNEW
(Empty)
1 dart_library.library('language/named_parameters_passing_zero_test', null, /* Imp orts */[
2 'dart_sdk',
3 'expect'
4 ], function load__named_parameters_passing_zero_test(exports, dart_sdk, expect) {
5 'use strict';
6 const core = dart_sdk.core;
7 const dart = dart_sdk.dart;
8 const dartx = dart_sdk.dartx;
9 const expect$ = expect.expect;
10 const named_parameters_passing_zero_test = Object.create(null);
11 let __Tonum = () => (__Tonum = dart.constFn(dart.definiteFunctionType(core.num , [], [core.num])))();
12 let __Tonum$ = () => (__Tonum$ = dart.constFn(dart.definiteFunctionType(core.n um, [], {value: core.num})))();
13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))();
14 named_parameters_passing_zero_test.TestClass = class TestClass extends core.Ob ject {
15 new() {
16 }
17 method(value) {
18 if (value === void 0) value = 100;
19 return value;
20 }
21 method2(opts) {
22 let value = opts && 'value' in opts ? opts.value : 100;
23 return value;
24 }
25 static staticMethod(value) {
26 if (value === void 0) value = 200;
27 return value;
28 }
29 static staticMethod2(opts) {
30 let value = opts && 'value' in opts ? opts.value : 200;
31 return value;
32 }
33 };
34 dart.setSignature(named_parameters_passing_zero_test.TestClass, {
35 constructors: () => ({new: dart.definiteFunctionType(named_parameters_passin g_zero_test.TestClass, [])}),
36 methods: () => ({
37 method: dart.definiteFunctionType(core.num, [], [core.num]),
38 method2: dart.definiteFunctionType(core.num, [], {value: core.num})
39 }),
40 statics: () => ({
41 staticMethod: dart.definiteFunctionType(core.num, [], [core.num]),
42 staticMethod2: dart.definiteFunctionType(core.num, [], {value: core.num})
43 }),
44 names: ['staticMethod', 'staticMethod2']
45 });
46 named_parameters_passing_zero_test.globalMethod = function(value) {
47 if (value === void 0) value = 300;
48 return value;
49 };
50 dart.fn(named_parameters_passing_zero_test.globalMethod, __Tonum());
51 named_parameters_passing_zero_test.globalMethod2 = function(opts) {
52 let value = opts && 'value' in opts ? opts.value : 300;
53 return value;
54 };
55 dart.fn(named_parameters_passing_zero_test.globalMethod2, __Tonum$());
56 named_parameters_passing_zero_test.main = function() {
57 let obj = new named_parameters_passing_zero_test.TestClass();
58 expect$.Expect.equals(100, obj.method());
59 expect$.Expect.equals(100, obj.method2());
60 expect$.Expect.equals(7, obj.method(7));
61 expect$.Expect.equals(7, obj.method2({value: 7}));
62 expect$.Expect.equals(0, obj.method(0));
63 expect$.Expect.equals(0, obj.method2({value: 0}));
64 expect$.Expect.equals(200, named_parameters_passing_zero_test.TestClass.stat icMethod());
65 expect$.Expect.equals(200, named_parameters_passing_zero_test.TestClass.stat icMethod2());
66 expect$.Expect.equals(7, named_parameters_passing_zero_test.TestClass.static Method(7));
67 expect$.Expect.equals(7, named_parameters_passing_zero_test.TestClass.static Method2({value: 7}));
68 expect$.Expect.equals(0, named_parameters_passing_zero_test.TestClass.static Method(0));
69 expect$.Expect.equals(0, named_parameters_passing_zero_test.TestClass.static Method2({value: 0}));
70 expect$.Expect.equals(300, named_parameters_passing_zero_test.globalMethod() );
71 expect$.Expect.equals(300, named_parameters_passing_zero_test.globalMethod2( ));
72 expect$.Expect.equals(7, named_parameters_passing_zero_test.globalMethod(7)) ;
73 expect$.Expect.equals(7, named_parameters_passing_zero_test.globalMethod2({v alue: 7}));
74 expect$.Expect.equals(0, named_parameters_passing_zero_test.globalMethod(0)) ;
75 expect$.Expect.equals(0, named_parameters_passing_zero_test.globalMethod2({v alue: 0}));
76 };
77 dart.fn(named_parameters_passing_zero_test.main, VoidTodynamic());
78 // Exports:
79 exports.named_parameters_passing_zero_test = named_parameters_passing_zero_tes t;
80 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698