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

Unified Diff: test/codegen/expect/language/private4_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/private4_test.js
diff --git a/test/codegen/expect/language/private4_test.js b/test/codegen/expect/language/private4_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..b475fbd5c62e1658623badc800e3a47e4536a72a
--- /dev/null
+++ b/test/codegen/expect/language/private4_test.js
@@ -0,0 +1,46 @@
+dart_library.library('language/private4_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__private4_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 private4_test = Object.create(null);
+ const other_library = Object.create(null);
+ let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [])))();
+ let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionType(core.bool, [dart.dynamic])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
+ private4_test.main = function() {
+ expect$.Expect.equals(42, other_library.foo(new other_library.A()));
+ expect$.Expect.throws(dart.fn(() => other_library.foo(new private4_test.B()), VoidTovoid()), dart.fn(e => core.NoSuchMethodError.is(e), dynamicTobool()));
+ };
+ dart.fn(private4_test.main, VoidTodynamic());
+ const _bar = Symbol('_bar');
+ private4_test.B = class B extends core.Object {
+ [_bar]() {
+ return 42;
+ }
+ };
+ dart.setSignature(private4_test.B, {
+ methods: () => ({[_bar]: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ const _bar$ = Symbol('_bar');
+ other_library.foo = function(a) {
+ return dart.dsend(a, _bar$);
+ };
+ dart.fn(other_library.foo, dynamicTodynamic());
+ other_library.A = class A extends core.Object {
+ [_bar$]() {
+ return 42;
+ }
+ };
+ dart.setSignature(other_library.A, {
+ methods: () => ({[_bar$]: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ // Exports:
+ exports.private4_test = private4_test;
+ exports.other_library = other_library;
+});
« no previous file with comments | « test/codegen/expect/language/private3_test.js ('k') | test/codegen/expect/language/private_access_test_01_multi.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698