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

Side by Side Diff: test/codegen_expected/language/call_function_apply_test.js

Issue 2200913002: fixes #616, statics on callable functions (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 4 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
1 dart_library.library('language/call_function_apply_test', null, /* Imports */[ 1 dart_library.library('language/call_function_apply_test', null, /* Imports */[
2 'dart_sdk', 2 'dart_sdk',
3 'expect' 3 'expect'
4 ], function load__call_function_apply_test(exports, dart_sdk, expect) { 4 ], function load__call_function_apply_test(exports, dart_sdk, expect) {
5 'use strict'; 5 'use strict';
6 const core = dart_sdk.core; 6 const core = dart_sdk.core;
7 const dart = dart_sdk.dart; 7 const dart = dart_sdk.dart;
8 const dartx = dart_sdk.dartx; 8 const dartx = dart_sdk.dartx;
9 const expect$ = expect.expect; 9 const expect$ = expect.expect;
10 const call_function_apply_test = Object.create(null); 10 const call_function_apply_test = Object.create(null);
11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))(); 11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))();
12 call_function_apply_test.A = dart.callableClass(function A(...args) { 12 call_function_apply_test.A = dart.callableClass(function A(...args) {
13 const self = this;
14 function call(...args) { 13 function call(...args) {
15 return self.call.apply(self, args); 14 return call.call.apply(call, args);
16 } 15 }
17 call.__proto__ = this.__proto__; 16 call.__proto__ = this.__proto__;
18 call.new.apply(call, args); 17 call.new.apply(call, args);
19 return call; 18 return call;
20 }, class A extends core.Object { 19 }, class A extends core.Object {
21 call(opts) { 20 call(opts) {
22 let a = opts && 'a' in opts ? opts.a : 42; 21 let a = opts && 'a' in opts ? opts.a : 42;
23 return 499 + dart.notNull(core.num._check(a)); 22 return 499 + dart.notNull(core.num._check(a));
24 } 23 }
25 }); 24 });
26 dart.setSignature(call_function_apply_test.A, { 25 dart.setSignature(call_function_apply_test.A, {
27 methods: () => ({call: dart.definiteFunctionType(dart.dynamic, [], {a: dart. dynamic})}) 26 methods: () => ({call: dart.definiteFunctionType(dart.dynamic, [], {a: dart. dynamic})})
28 }); 27 });
29 let const$; 28 let const$;
30 call_function_apply_test.main = function() { 29 call_function_apply_test.main = function() {
31 expect$.Expect.equals(497, core.Function.apply(new call_function_apply_test. A(), [], dart.map([const$ || (const$ = dart.const(core.Symbol.new('a'))), -2]))) ; 30 expect$.Expect.equals(497, core.Function.apply(new call_function_apply_test. A(), [], dart.map([const$ || (const$ = dart.const(core.Symbol.new('a'))), -2]))) ;
32 }; 31 };
33 dart.fn(call_function_apply_test.main, VoidTodynamic()); 32 dart.fn(call_function_apply_test.main, VoidTodynamic());
34 // Exports: 33 // Exports:
35 exports.call_function_apply_test = call_function_apply_test; 34 exports.call_function_apply_test = call_function_apply_test;
36 }); 35 });
OLDNEW
« no previous file with comments | « test/codegen_expected/language/call_argument_inference_test.js ('k') | test/codegen_expected/language/call_operator_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698