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

Side by Side Diff: test/codegen/expect/language/null_access_error_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 unified diff | Download patch
OLDNEW
(Empty)
1 dart_library.library('language/null_access_error_test', null, /* Imports */[
2 'dart_sdk',
3 'expect'
4 ], function load__null_access_error_test(exports, dart_sdk, expect) {
5 'use strict';
6 const core = dart_sdk.core;
7 const dart = dart_sdk.dart;
8 const dartx = dart_sdk.dartx;
9 const expect$ = expect.expect;
10 const null_access_error_test = Object.create(null);
11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))();
12 null_access_error_test.NullAccessTest = class NullAccessTest extends core.Obje ct {
13 static testNullVariable() {
14 let variable = null;
15 let exceptionCaught = false;
16 let wrongExceptionCaught = false;
17 try {
18 variable = dart.notNull(variable) + 1;
19 } catch (e) {
20 if (core.NoSuchMethodError.is(e)) {
21 let ex = e;
22 exceptionCaught = true;
23 } else {
24 let ex = e;
25 wrongExceptionCaught = true;
26 }
27 }
28
29 expect$.Expect.isTrue(exceptionCaught);
30 expect$.Expect.isFalse(wrongExceptionCaught);
31 }
32 static helperFunction(parameter) {
33 let x = parameter;
34 parameter = dart.notNull(x) + 1;
35 return x;
36 }
37 static testNullFunctionCall() {
38 let variable = null;
39 let exceptionCaught = false;
40 let wrongExceptionCaught = false;
41 try {
42 variable = null_access_error_test.NullAccessTest.helperFunction(variable );
43 } catch (e) {
44 if (core.NoSuchMethodError.is(e)) {
45 let ex = e;
46 exceptionCaught = true;
47 } else {
48 let ex = e;
49 wrongExceptionCaught = true;
50 }
51 }
52
53 expect$.Expect.isTrue(exceptionCaught);
54 expect$.Expect.isFalse(wrongExceptionCaught);
55 }
56 static testMain() {
57 null_access_error_test.NullAccessTest.testNullVariable();
58 null_access_error_test.NullAccessTest.testNullFunctionCall();
59 }
60 };
61 dart.setSignature(null_access_error_test.NullAccessTest, {
62 statics: () => ({
63 testNullVariable: dart.definiteFunctionType(dart.void, []),
64 helperFunction: dart.definiteFunctionType(core.int, [core.int]),
65 testNullFunctionCall: dart.definiteFunctionType(dart.void, []),
66 testMain: dart.definiteFunctionType(dart.void, [])
67 }),
68 names: ['testNullVariable', 'helperFunction', 'testNullFunctionCall', 'testM ain']
69 });
70 null_access_error_test.main = function() {
71 null_access_error_test.NullAccessTest.testMain();
72 };
73 dart.fn(null_access_error_test.main, VoidTodynamic());
74 // Exports:
75 exports.null_access_error_test = null_access_error_test;
76 });
OLDNEW
« no previous file with comments | « test/codegen/expect/language/null2_test.js ('k') | test/codegen/expect/language/null_inline_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698