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

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

Issue 2962263002: fix #30030, fix #27327 - fix tearoffs and various Object member bugs (Closed)
Patch Set: fix 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
Index: pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart
diff --git a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart
index 23e1a2fd87769019481386a133ed9ea8beba8e05..384df2d80cabfabaa0f24ecc15222ce568b17389 100644
--- a/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart
+++ b/pkg/dev_compiler/tool/input_sdk/private/ddc_runtime/rtti.dart
@@ -151,36 +151,13 @@ _nonPrimitiveRuntimeType(obj) {
/// Given an internal runtime type object, wraps it in a `WrappedType` object
/// that implements the dart:core Type interface.
-wrapType(type) {
+Type wrapType(type) {
// If we've already wrapped this type once, use the previous wrapper. This
// way, multiple references to the same type return an identical Type.
if (JS('bool', '#.hasOwnProperty(#)', type, _typeObject)) {
return JS('', '#[#]', type, _typeObject);
}
- return JS('', '#[#] = #', type, _typeObject, new WrappedType(type));
-}
-
-var _lazyJSTypes = JS('', 'new Map()');
-
-lazyJSType(getJSTypeCallback, name) {
- var key = JS('String', '#.toString()', getJSTypeCallback);
- if (JS('bool', '#.has(#)', _lazyJSTypes, key)) {
- return JS('', '#.get(#)', _lazyJSTypes, key);
- }
- var ret = new LazyJSType(getJSTypeCallback, name);
- JS('', '#.set(#, #)', _lazyJSTypes, key, ret);
- return ret;
-}
-
-// TODO(jacobr): do not use the same LazyJSType object for anonymous JS types
-// from different libraries.
-lazyAnonymousJSType(name) {
- if (JS('bool', '#.has(#)', _lazyJSTypes, name)) {
- return JS('', '#.get(#)', _lazyJSTypes, name);
- }
- var ret = new LazyJSType(null, name);
- JS('', '#.set(#, #)', _lazyJSTypes, name, ret);
- return ret;
+ return JS('Type', '#[#] = #', type, _typeObject, new WrappedType(type));
}
/// Given a WrappedType, return the internal runtime type object.
@@ -197,12 +174,11 @@ void tag(value, t) {
}
void tagComputed(value, compute) {
- JS('', '#(#, #, { get: # })', defineProperty, value, _runtimeType, compute);
+ defineGetter(value, _runtimeType, compute);
}
void tagLazy(value, compute) {
- JS('', '#(#, #, { get: # })', defineLazyProperty, value, _runtimeType,
- compute);
+ defineMemoizedGetter(value, _runtimeType, compute);
}
var _loadedModules = JS('', 'new Map()');

Powered by Google App Engine
This is Rietveld 408576698