Chromium Code Reviews| Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart |
| diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart |
| index 03ff5a095a84a77496973b7f0dbbfec613d6a86c..0cc9156901d002ddda6b3737588325a3e414875c 100644 |
| --- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart |
| +++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/errors.dart |
| @@ -3,17 +3,21 @@ |
| // BSD-style license that can be found in the LICENSE file. |
| part of dart._runtime; |
| -bool _trapRuntimeErrors = true; |
| -bool _ignoreWhitelistedErrors = true; |
| -bool _failForWeakModeIsChecks = true; |
| +// We need to set these properties while the sdk is only partially initialized |
| +// so we cannot use regular Dart fields. |
| +bool get _trapRuntimeErrors => JS('bool', 'dart.__trapRuntimeErrors'); |
|
vsm
2017/05/11 21:45:56
Can you add a comment as to where these are now ac
|
| +bool get _ignoreWhitelistedErrors => |
| + JS('bool', 'dart.__ignoreWhitelistedErrors'); |
| +bool get _failForWeakModeIsChecks => |
| + JS('bool', 'dart.__failForWeakModeIsChecks'); |
| // Override, e.g., for testing |
| void trapRuntimeErrors(bool flag) { |
| - _trapRuntimeErrors = flag; |
| + JS('', 'dart.__trapRuntimeErrors = #', flag); |
| } |
| void ignoreWhitelistedErrors(bool flag) { |
| - _ignoreWhitelistedErrors = flag; |
| + JS('', 'dart.__ignoreWhitelistedErrors = #', flag); |
| } |
| /// Throw an exception on `is` checks that would return an unsound answer in |
| @@ -32,7 +36,7 @@ void ignoreWhitelistedErrors(bool flag) { |
| /// well as generic types when the type parameter was inferred. Setting this |
| /// flag to `true` will not catch these differences in behavior..) |
| void failForWeakModeIsChecks(bool flag) { |
| - _failForWeakModeIsChecks = flag; |
| + JS('', 'dart.__failForWeakModeIsChecks = #', flag); |
| } |
| throwCastError(object, actual, type) => JS( |