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

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

Issue 2158173003: fix #603, support mock objects (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/no_such_method_native_test', null, /* Imports */[
Leaf 2016/07/18 23:06:07 Is the baseline for this patch set out of date? I
2 'dart_sdk',
3 'expect'
4 ], function load__no_such_method_native_test(exports, dart_sdk, expect) {
5 'use strict';
6 const core = dart_sdk.core;
7 const _interceptors = dart_sdk._interceptors;
8 const dart = dart_sdk.dart;
9 const dartx = dart_sdk.dartx;
10 const expect$ = expect.expect;
11 const no_such_method_native_test = Object.create(null);
12 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c ore.int)))();
13 let ObjectTodynamic = () => (ObjectTodynamic = dart.constFn(dart.definiteFunct ionType(dart.dynamic, [core.Object])))();
14 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))();
15 no_such_method_native_test.invocation = null;
16 no_such_method_native_test.C = class C extends core.Object {
17 noSuchMethod(i) {
18 no_such_method_native_test.invocation = i;
19 return 42;
20 }
21 };
22 no_such_method_native_test.expectNSME = function(d) {
23 try {
24 dart.noSuchMethod(d, no_such_method_native_test.invocation);
25 } catch (e) {
26 if (core.NoSuchMethodError.is(e)) {
27 expect$.Expect.isTrue(dart.toString(e)[dartx.contains]('foobar'));
28 } else
29 throw e;
30 }
31
32 };
33 dart.fn(no_such_method_native_test.expectNSME, ObjectTodynamic());
34 let const$;
35 no_such_method_native_test.main = function() {
36 let c = new no_such_method_native_test.C();
37 expect$.Expect.equals(42, dart.dsend(c, 'foobar', 123));
38 expect$.Expect.equals(no_such_method_native_test.invocation.memberName, cons t$ || (const$ = dart.const(core.Symbol.new('foobar'))));
39 expect$.Expect.listEquals(no_such_method_native_test.invocation.positionalAr guments, JSArrayOfint().of([123]));
40 no_such_method_native_test.expectNSME(null);
41 no_such_method_native_test.expectNSME(777);
42 no_such_method_native_test.expectNSME('hello');
43 };
44 dart.fn(no_such_method_native_test.main, VoidTodynamic());
45 // Exports:
46 exports.no_such_method_native_test = no_such_method_native_test;
47 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698