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

Unified Diff: test/codegen/expect/language/custom_await_stack_trace_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/custom_await_stack_trace_test.js
diff --git a/test/codegen/expect/language/custom_await_stack_trace_test.js b/test/codegen/expect/language/custom_await_stack_trace_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..0f94cc5075b4b8fa948cf6b2bdbf4848b1836b05
--- /dev/null
+++ b/test/codegen/expect/language/custom_await_stack_trace_test.js
@@ -0,0 +1,52 @@
+dart_library.library('language/custom_await_stack_trace_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__custom_await_stack_trace_test(exports, dart_sdk, expect) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const async = dart_sdk.async;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const custom_await_stack_trace_test = Object.create(null);
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ const _trace = Symbol('_trace');
+ custom_await_stack_trace_test.Blah = class Blah extends core.Object {
+ new(trace) {
+ this[_trace] = trace;
+ }
+ toString() {
+ return "Blah " + dart.notNull(dart.toString(this[_trace]));
+ }
+ };
+ custom_await_stack_trace_test.Blah[dart.implements] = () => [core.StackTrace];
+ dart.setSignature(custom_await_stack_trace_test.Blah, {
+ constructors: () => ({new: dart.definiteFunctionType(custom_await_stack_trace_test.Blah, [dart.dynamic])})
+ });
+ custom_await_stack_trace_test.foo = function() {
+ let x = "\nBloop\nBleep\n";
+ return async.Future.error(42, new custom_await_stack_trace_test.Blah(x));
+ };
+ dart.fn(custom_await_stack_trace_test.foo, VoidTodynamic());
+ custom_await_stack_trace_test.main = function() {
+ return dart.async(function*() {
+ try {
+ let x = (yield custom_await_stack_trace_test.foo());
+ expect$.Expect.fail("Should not reach here.");
+ } catch (e) {
+ if (core.int.is(e)) {
+ let s = dart.stackTrace(e);
+ expect$.Expect.equals(42, e);
+ expect$.Expect.equals("Blah \nBloop\nBleep\n", s.toString());
+ return;
+ } else
+ throw e;
+ }
+
+ expect$.Expect.fail("Unreachable.");
+ }, dart.dynamic);
+ };
+ dart.fn(custom_await_stack_trace_test.main, VoidTodynamic());
+ // Exports:
+ exports.custom_await_stack_trace_test = custom_await_stack_trace_test;
+});
« no previous file with comments | « test/codegen/expect/language/ct_const_test.js ('k') | test/codegen/expect/language/cyclic_class_member_test_01_multi.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698