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

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

Issue 14690017: Version 0.5.7.2 . (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 7 years, 7 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 | tools/VERSION » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/lib/interceptors.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/lib/interceptors.dart (revision 22601)
+++ sdk/lib/_internal/compiler/implementation/lib/interceptors.dart (working copy)
@@ -15,6 +15,7 @@
checkNull,
checkNum,
checkString,
+ defineProperty,
getRuntimeType,
regExpGetNative,
stringContainsUnchecked,
@@ -43,34 +44,27 @@
/**
* The name of the property used on native classes and `Object.prototype` to get
* the interceptor for a native class instance. The value is initialized on
- * isolate startup.
+ * isolate startup to ensure no two Dart programs in the same page use the same
+ * property.
*/
var dispatchPropertyName = null;
getDispatchProperty(object) {
- // TODO(sra): Implement the magic.
// This is a magic method: the compiler replaces it with a runtime generated
// function
//
// function(object){return object._zzyzx;}
//
- // where _zzyzx is replaced with the actual [dispatchPropertyName].
+ // where `_zzyzx` is replaced with the actual [dispatchPropertyName].
//
- // The body is the CSP compliant version.
+ // The CSP compliant version replaces this function with one of a few
+ // pre-compiled accessors, unless the pre-compiled versions are all in use,
+ // when it falls back on this code.
return JS('', '#[#]', object, dispatchPropertyName);
}
setDispatchProperty(object, value) {
- // TODO(sra): Implement the magic.
- // This is a magic method: the compiler replaces it with a runtime generated
- // function
- //
- // function(object, value){object._zzyzx = value;}
- //
- // where _zzyzx is replaced with the actual [dispatchPropertyName].
- //
- // The body is the CSP compliant version.
- JS('void', '#[#] = #', object, dispatchPropertyName, value);
+ defineProperty(object, dispatchPropertyName, value);
}
makeDispatchRecord(interceptor, proto, extension) {
« no previous file with comments | « no previous file | tools/VERSION » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698