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

Unified Diff: test/codegen/expect/language/issue12284_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/issue12023_test.js ('k') | test/codegen/expect/language/issue12288_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/language/issue12284_test.js
diff --git a/test/codegen/expect/language/issue12284_test.js b/test/codegen/expect/language/issue12284_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..894452c7aff508c8be4001c9aad9036bfc8500ce
--- /dev/null
+++ b/test/codegen/expect/language/issue12284_test.js
@@ -0,0 +1,48 @@
+dart_library.library('language/issue12284_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__issue12284_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 issue12284_test = Object.create(null);
+ const compiler_annotations = Object.create(null);
+ let VoidToint = () => (VoidToint = dart.constFn(dart.definiteFunctionType(core.int, [])))();
+ let VoidToA = () => (VoidToA = dart.constFn(dart.definiteFunctionType(issue12284_test.A, [])))();
+ let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionType(core.bool, [dart.dynamic])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ issue12284_test.A = class A extends core.Object {
+ new(param) {
+ this.field = null;
+ let bar = dart.fn(() => 42, VoidToint());
+ this.field = core.int._check(dart.dsend(param, '+', 42));
+ }
+ redirect() {
+ A.prototype.new.call(this, 'foo');
+ }
+ };
+ dart.defineNamedConstructor(issue12284_test.A, 'redirect');
+ dart.setSignature(issue12284_test.A, {
+ constructors: () => ({
+ new: dart.definiteFunctionType(issue12284_test.A, [dart.dynamic]),
+ redirect: dart.definiteFunctionType(issue12284_test.A, [])
+ })
+ });
+ issue12284_test.main = function() {
+ expect$.Expect.equals(42 + 42, new issue12284_test.A(42).field);
+ expect$.Expect.throws(dart.fn(() => new issue12284_test.A.redirect(), VoidToA()), dart.fn(e => core.ArgumentError.is(e) || core.TypeError.is(e) || core.NoSuchMethodError.is(e), dynamicTobool()));
+ };
+ dart.fn(issue12284_test.main, VoidTodynamic());
+ compiler_annotations.DontInline = class DontInline extends core.Object {
+ new() {
+ }
+ };
+ dart.setSignature(compiler_annotations.DontInline, {
+ constructors: () => ({new: dart.definiteFunctionType(compiler_annotations.DontInline, [])})
+ });
+ // Exports:
+ exports.issue12284_test = issue12284_test;
+ exports.compiler_annotations = compiler_annotations;
+});
« no previous file with comments | « test/codegen/expect/language/issue12023_test.js ('k') | test/codegen/expect/language/issue12288_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698