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

Unified Diff: test/codegen/expect/language/method_invocation_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/method_invocation_test.js
diff --git a/test/codegen/expect/language/method_invocation_test.js b/test/codegen/expect/language/method_invocation_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..32290c32b6587b51b59bdddc96aa2c983f794596
--- /dev/null
+++ b/test/codegen/expect/language/method_invocation_test.js
@@ -0,0 +1,73 @@
+dart_library.library('language/method_invocation_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__method_invocation_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 method_invocation_test = Object.create(null);
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ method_invocation_test.A = class A extends core.Object {
+ new() {
+ }
+ foo() {
+ return 1;
+ }
+ };
+ dart.setSignature(method_invocation_test.A, {
+ constructors: () => ({new: dart.definiteFunctionType(method_invocation_test.A, [])}),
+ methods: () => ({foo: dart.definiteFunctionType(core.int, [])})
+ });
+ method_invocation_test.B = class B extends core.Object {
+ get f() {
+ dart.throw(123);
+ }
+ };
+ method_invocation_test.MethodInvocationTest = class MethodInvocationTest extends core.Object {
+ static testNullReceiver() {
+ let a = new method_invocation_test.A();
+ expect$.Expect.equals(1, a.foo());
+ a = null;
+ let exceptionCaught = false;
+ try {
+ a.foo();
+ } catch (e) {
+ if (core.NoSuchMethodError.is(e)) {
+ exceptionCaught = true;
+ } else
+ throw e;
+ }
+
+ expect$.Expect.equals(true, exceptionCaught);
+ }
+ static testGetterMethodInvocation() {
+ let b = new method_invocation_test.B();
+ try {
+ dart.dsend(b, 'f');
+ } catch (e) {
+ expect$.Expect.equals(123, e);
+ }
+
+ }
+ static testMain() {
+ method_invocation_test.MethodInvocationTest.testNullReceiver();
+ method_invocation_test.MethodInvocationTest.testGetterMethodInvocation();
+ }
+ };
+ dart.setSignature(method_invocation_test.MethodInvocationTest, {
+ statics: () => ({
+ testNullReceiver: dart.definiteFunctionType(dart.void, []),
+ testGetterMethodInvocation: dart.definiteFunctionType(dart.dynamic, []),
+ testMain: dart.definiteFunctionType(dart.void, [])
+ }),
+ names: ['testNullReceiver', 'testGetterMethodInvocation', 'testMain']
+ });
+ method_invocation_test.main = function() {
+ method_invocation_test.MethodInvocationTest.testMain();
+ };
+ dart.fn(method_invocation_test.main, VoidTodynamic());
+ // Exports:
+ exports.method_invocation_test = method_invocation_test;
+});
« no previous file with comments | « test/codegen/expect/language/method_binding_test.js ('k') | test/codegen/expect/language/method_name_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698