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

Side by Side Diff: tests/compiler/dart2js_native/native_exception_test.dart

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Test that dart2js can handle unexpected exception types. 5 // Test that dart2js can handle unexpected exception types.
6 6
7 library native_exception_test; 7 library native_exception_test;
8 8
9 import 'dart:_foreign_helper' show JS; 9 import 'dart:_foreign_helper' show JS;
10 import 'dart:_js_helper'; 10 import 'dart:_js_helper';
11 import 'package:expect/expect.dart'; 11 import 'package:expect/expect.dart';
12 12
13 main() { 13 main() {
14 var previous; 14 var previous;
15 check(e) { 15 check(e) {
16 print('$e'); 16 print('$e');
17 Expect.equals(e, e); 17 Expect.equals(e, e);
18 Expect.notEquals(e, new Object()); 18 Expect.notEquals(e, new Object());
19 Expect.notEquals(e, previous); 19 Expect.notEquals(e, previous);
20 previous = e; 20 previous = e;
21 return '$e' != '[object Object]'; 21 return '$e' != '[object Object]';
22 } 22 }
23 Expect.throws(() { JS('void', 'noGlobalVariableWithThisName'); }, check); 23 Expect.throws(() {
24 Expect.throws(() { JS('void', 'throw 3'); }, check); 24 JS('void', 'noGlobalVariableWithThisName');
25 Expect.throws( 25 }, check);
26 () { 26 Expect.throws(() {
27 JS('bool', 'Object.prototype.hasOwnProperty.call(undefined, "foo")'); 27 JS('void', 'throw 3');
28 }, 28 }, check);
29 check); 29 Expect.throws(() {
30 Expect.throws(() { JS('void', 'throw new ReferenceError()'); }, check); 30 JS('bool', 'Object.prototype.hasOwnProperty.call(undefined, "foo")');
31 Expect.throws(() { JS('void', 'throw void 0'); }, check); 31 }, check);
32 Expect.throws(() { JS('void', 'throw "a string"'); }, check); 32 Expect.throws(() {
33 Expect.throws(() { JS('void', 'throw null'); }, check); 33 JS('void', 'throw new ReferenceError()');
34 }, check);
35 Expect.throws(() {
36 JS('void', 'throw void 0');
37 }, check);
38 Expect.throws(() {
39 JS('void', 'throw "a string"');
40 }, check);
41 Expect.throws(() {
42 JS('void', 'throw null');
43 }, check);
34 } 44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698