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

Unified Diff: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart

Issue 2980133002: Move null check out of getExtensionType (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
index 057e3b875582459b7db9d64b943c8359db93b980..fdaffe8312549fa9a602d278f2355638f2df4e7e 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/classes.dart
@@ -214,6 +214,7 @@ getType(obj) =>
JS('', '# == null ? # : #.__proto__.constructor', obj, Object, obj);
bool isJsInterop(obj) {
+ if (obj == null) return false;
if (JS('bool', 'typeof # === "function"', obj)) {
// A function is a Dart function if it has runtime type information.
return _getRuntimeType(obj) == null;
@@ -391,8 +392,8 @@ bool hasField(type, name) => _hasSigEntry(type, _fieldSig, name);
final _extensionType = JS('', 'Symbol("extensionType")');
-getExtensionType(obj) =>
- JS('', '# == null ? null : #[#]', obj, obj, _extensionType);
+/// This assumes that obj is not null
+getExtensionType(obj) => JS('', '#[#]', obj, _extensionType);
final dartx = JS('', 'dartx');
« no previous file with comments | « no previous file | pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698