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

Unified Diff: sdk/lib/_internal/lib/interceptors.dart

Issue 35893008: Preemptive initialization of dispatch records (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | sdk/lib/_internal/lib/native_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/lib/interceptors.dart
diff --git a/sdk/lib/_internal/lib/interceptors.dart b/sdk/lib/_internal/lib/interceptors.dart
index bfdbb36b16dae106c533f6ead39251fd251642f1..e87ce4fad2b33c5a7b074ba2edba124c2e4874fb 100644
--- a/sdk/lib/_internal/lib/interceptors.dart
+++ b/sdk/lib/_internal/lib/interceptors.dart
@@ -16,6 +16,8 @@ import 'dart:_js_helper' show allMatchesInStringUnchecked,
checkString,
defineProperty,
getRuntimeType,
+ initNativeDispatch,
+ initNativeDispatchFlag,
regExpGetNative,
stringContainsUnchecked,
stringLastIndexOfUnchecked,
@@ -115,6 +117,13 @@ dispatchRecordIndexability(record) => JS('bool|Null', '#.x', record);
getNativeInterceptor(object) {
var record = getDispatchProperty(object);
+ if (record == null) {
+ if (initNativeDispatchFlag == null) {
+ initNativeDispatch();
+ record = getDispatchProperty(object);
+ }
+ }
+
if (record != null) {
var proto = dispatchRecordProto(record);
if (false == proto) return dispatchRecordInterceptor(record);
@@ -142,7 +151,6 @@ getNativeInterceptor(object) {
return getNativeInterceptor(object);
}
-
/**
* If [JSInvocationMirror._invokeOn] is being used, this variable
* contains a JavaScript array with the names of methods that are
« no previous file with comments | « no previous file | sdk/lib/_internal/lib/native_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698