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

Unified Diff: lib/runtime/dart_sdk.js

Side-by-side diff isn't available for this file because of its large size.
Issue 2007423003: Short circuit for 'as dynamic' (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 6 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:
Download patch
Index: lib/runtime/dart_sdk.js
diff --git a/lib/runtime/dart_sdk.js b/lib/runtime/dart_sdk.js
index 12485f53c4a730bcba779a16ae32fac7815bf3f0..b0d66f601e5048266b4f6d193fe7beb9eb367488 100644
--- a/lib/runtime/dart_sdk.js
+++ b/lib/runtime/dart_sdk.js
@@ -1124,7 +1124,7 @@ dart_library.library('dart_sdk', null, /* Imports */[
dart.throwStrongModeError('Strong mode is check failure: ' + dart.typeName(actual) + ' does not soundly subtype ' + dart.typeName(type));
};
dart.as = function(obj, type) {
- if (obj == null) return obj;
+ if (type == dart.dynamic || obj == null) return obj;
let result = dart.strongInstanceOf(obj, type, true);
if (result) return obj;
dart._throwCastError(obj, type, result);
« no previous file with comments | « no previous file | tool/input_sdk/private/ddc_runtime/operations.dart » ('j') | tool/input_sdk/private/ddc_runtime/operations.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698