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

Unified Diff: test/codegen/expect/language/regress_21795_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/regress_21795_test.js
diff --git a/test/codegen/expect/language/regress_21795_test.js b/test/codegen/expect/language/regress_21795_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..4e4874ced9b3841f93e56306bc031787fe627565
--- /dev/null
+++ b/test/codegen/expect/language/regress_21795_test.js
@@ -0,0 +1,61 @@
+dart_library.library('language/regress_21795_test', null, /* Imports */[
+ 'dart_sdk'
+], function load__regress_21795_test(exports, dart_sdk) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const regress_21795_test = Object.create(null);
+ let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ regress_21795_test.foo = function(t) {
+ try {
+ if (dart.equals(t, 123)) dart.throw(42);
+ } finally {
+ }
+ };
+ dart.fn(regress_21795_test.foo, dynamicTodynamic());
+ regress_21795_test.bar = function() {
+ try {
+ return 42;
+ } finally {
+ }
+ };
+ dart.fn(regress_21795_test.bar, VoidTodynamic());
+ regress_21795_test.A = class A extends core.Object {
+ test(t) {
+ try {
+ regress_21795_test.foo(t);
+ } finally {
+ if (dart.equals(t, 0)) {
+ try {
+ } catch (err) {
+ let st = dart.stackTrace(err);
+ }
+
+ }
+ }
+ }
+ };
+ dart.setSignature(regress_21795_test.A, {
+ methods: () => ({test: dart.definiteFunctionType(dart.dynamic, [dart.dynamic])})
+ });
+ regress_21795_test.main = function() {
+ let a = new regress_21795_test.A();
+ for (let i = 0; i < 10000; ++i)
+ a.test(0);
+ try {
+ a.test(123);
+ } catch (e) {
+ let s = dart.stackTrace(e);
+ if (s.toString()[dartx.indexOf]("foo") == -1) {
+ core.print(s);
+ dart.throw("Expected foo in stacktrace!");
+ }
+ }
+
+ };
+ dart.fn(regress_21795_test.main, VoidTodynamic());
+ // Exports:
+ exports.regress_21795_test = regress_21795_test;
+});

Powered by Google App Engine
This is Rietveld 408576698