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

Unified Diff: test/codegen/expect/language/megamorphic_no_such_method_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
« no previous file with comments | « test/codegen/expect/language/mega_load_test.js ('k') | test/codegen/expect/language/memory_swap_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/language/megamorphic_no_such_method_test.js
diff --git a/test/codegen/expect/language/megamorphic_no_such_method_test.js b/test/codegen/expect/language/megamorphic_no_such_method_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..b8ed17b2b194faa223a631587f65c20b1a136c8a
--- /dev/null
+++ b/test/codegen/expect/language/megamorphic_no_such_method_test.js
@@ -0,0 +1,114 @@
+dart_library.library('language/megamorphic_no_such_method_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__megamorphic_no_such_method_test(exports, dart_sdk, expect) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const _interceptors = dart_sdk._interceptors;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const megamorphic_no_such_method_test = Object.create(null);
+ let JSArrayOfObject = () => (JSArrayOfObject = dart.constFn(_interceptors.JSArray$(core.Object)))();
+ let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
+ 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, [])))();
+ megamorphic_no_such_method_test.A0 = class A0 extends core.Object {
+ test() {
+ return 0;
+ }
+ };
+ dart.setSignature(megamorphic_no_such_method_test.A0, {
+ methods: () => ({test: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ megamorphic_no_such_method_test.A1 = class A1 extends core.Object {
+ test() {
+ return 1;
+ }
+ };
+ dart.setSignature(megamorphic_no_such_method_test.A1, {
+ methods: () => ({test: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ megamorphic_no_such_method_test.A2 = class A2 extends core.Object {
+ test() {
+ return 2;
+ }
+ };
+ dart.setSignature(megamorphic_no_such_method_test.A2, {
+ methods: () => ({test: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ megamorphic_no_such_method_test.A3 = class A3 extends core.Object {
+ test() {
+ return 3;
+ }
+ };
+ dart.setSignature(megamorphic_no_such_method_test.A3, {
+ methods: () => ({test: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ megamorphic_no_such_method_test.A4 = class A4 extends core.Object {
+ test() {
+ return 4;
+ }
+ };
+ dart.setSignature(megamorphic_no_such_method_test.A4, {
+ methods: () => ({test: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ megamorphic_no_such_method_test.A5 = class A5 extends core.Object {
+ test() {
+ return 5;
+ }
+ };
+ dart.setSignature(megamorphic_no_such_method_test.A5, {
+ methods: () => ({test: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ megamorphic_no_such_method_test.A6 = class A6 extends core.Object {
+ test() {
+ return 6;
+ }
+ };
+ dart.setSignature(megamorphic_no_such_method_test.A6, {
+ methods: () => ({test: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ megamorphic_no_such_method_test.A7 = class A7 extends core.Object {
+ test() {
+ return 7;
+ }
+ };
+ dart.setSignature(megamorphic_no_such_method_test.A7, {
+ methods: () => ({test: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ megamorphic_no_such_method_test.A8 = class A8 extends core.Object {
+ test() {
+ return 8;
+ }
+ };
+ dart.setSignature(megamorphic_no_such_method_test.A8, {
+ methods: () => ({test: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ megamorphic_no_such_method_test.A9 = class A9 extends core.Object {
+ test() {
+ return 9;
+ }
+ };
+ dart.setSignature(megamorphic_no_such_method_test.A9, {
+ methods: () => ({test: dart.definiteFunctionType(dart.dynamic, [])})
+ });
+ megamorphic_no_such_method_test.B = class B extends core.Object {};
+ megamorphic_no_such_method_test.test = function(obj) {
+ return dart.dsend(obj, 'test');
+ };
+ dart.fn(megamorphic_no_such_method_test.test, dynamicTodynamic());
+ megamorphic_no_such_method_test.main = function() {
+ let list = JSArrayOfObject().of([new megamorphic_no_such_method_test.A0(), new megamorphic_no_such_method_test.A1(), new megamorphic_no_such_method_test.A2(), new megamorphic_no_such_method_test.A3(), new megamorphic_no_such_method_test.A4(), new megamorphic_no_such_method_test.A5(), new megamorphic_no_such_method_test.A6(), new megamorphic_no_such_method_test.A7(), new megamorphic_no_such_method_test.A8(), new megamorphic_no_such_method_test.A9()]);
+ for (let i = 0; i < 20; i++) {
+ for (let obj of list) {
+ megamorphic_no_such_method_test.test(obj);
+ }
+ }
+ expect$.Expect.throws(dart.fn(() => megamorphic_no_such_method_test.test(new megamorphic_no_such_method_test.B()), VoidTovoid()), dart.fn(e => core.NoSuchMethodError.is(e), dynamicTobool()));
+ };
+ dart.fn(megamorphic_no_such_method_test.main, VoidTodynamic());
+ // Exports:
+ exports.megamorphic_no_such_method_test = megamorphic_no_such_method_test;
+});
« no previous file with comments | « test/codegen/expect/language/mega_load_test.js ('k') | test/codegen/expect/language/memory_swap_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698