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

Side by Side Diff: dart/sdk/lib/js/dart2js/js_dart2js.dart

Issue 125033003: Version 1.1.0-dev.5.1 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Support for interoperating with JavaScript. 6 * Support for interoperating with JavaScript.
7 * 7 *
8 * This library provides access to JavaScript objects from Dart, allowing 8 * This library provides access to JavaScript objects from Dart, allowing
9 * Dart code to get and set properties, and call methods of JavaScript objects 9 * Dart code to get and set properties, and call methods of JavaScript objects
10 * and invoke JavaScript functions. The library takes care of converting 10 * and invoke JavaScript functions. The library takes care of converting
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 return _getDartProxy(o, _DART_OBJECT_PROPERTY_NAME, 537 return _getDartProxy(o, _DART_OBJECT_PROPERTY_NAME,
538 (o) => new JsArray._fromJs(o)); 538 (o) => new JsArray._fromJs(o));
539 } else { 539 } else {
540 return _getDartProxy(o, _DART_OBJECT_PROPERTY_NAME, 540 return _getDartProxy(o, _DART_OBJECT_PROPERTY_NAME,
541 (o) => new JsObject._fromJs(o)); 541 (o) => new JsObject._fromJs(o));
542 } 542 }
543 } 543 }
544 544
545 Object _getDartProxy(o, String propertyName, createProxy(o)) { 545 Object _getDartProxy(o, String propertyName, createProxy(o)) {
546 var dartProxy = JS('', '#[#]', o, propertyName); 546 var dartProxy = JS('', '#[#]', o, propertyName);
547 if (dartProxy == null) { 547 // Temporary fix for dartbug.com/15193
548 // In some cases it's possible to see a JavaScript object that
549 // came from a different context and was previously proxied to
550 // Dart in that context. The JS object will have a cached proxy
551 // but it won't be a valid Dart object in this context.
552 // For now we throw away the cached proxy, but we should be able
553 // to cache proxies from multiple JS contexts and Dart isolates.
554 if (dartProxy == null || !_isLocalObject(o)) {
548 dartProxy = createProxy(o); 555 dartProxy = createProxy(o);
549 _defineProperty(o, propertyName, dartProxy); 556 _defineProperty(o, propertyName, dartProxy);
550 } 557 }
551 return dartProxy; 558 return dartProxy;
552 } 559 }
OLDNEW
« no previous file with comments | « dart/sdk/lib/_internal/lib/js_rti.dart ('k') | dart/tests/compiler/dart2js/mirrors_used_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698