OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library polymer.src.common.polymer_js_proxy; | 4 library polymer.src.common.polymer_js_proxy; |
5 | 5 |
6 import 'dart:js'; | 6 import 'dart:js'; |
7 import 'package:polymer_interop/polymer_interop.dart' show Polymer, PolymerDom; | 7 import 'package:polymer_interop/polymer_interop.dart' show Polymer, PolymerDom; |
8 import 'package:web_components/web_components.dart'; | 8 import 'package:web_components/web_components.dart'; |
9 import 'js_proxy.dart'; | 9 import 'js_proxy.dart'; |
10 | 10 |
11 /// Basic api for re-using the polymer js prototypes. | 11 /// Basic api for re-using the polymer js prototypes. |
12 abstract class PolymerMixin implements JsProxy, CustomElementProxyMixin { | 12 abstract class PolymerMixin implements JsProxy, CustomElementProxyMixin { |
13 JsObject _proxy; | 13 JsObject _proxy; |
14 | 14 |
15 JsObject get jsElement { | 15 JsObject get jsElement { |
16 if (_proxy == null) { | 16 if (_proxy == null) { |
17 _proxy = new JsObject.fromBrowserObject(this); | 17 _proxy = new JsObject.fromBrowserObject(this); |
18 _proxy['__data__'] = jsProxy; | |
19 } | 18 } |
20 return _proxy; | 19 return _proxy; |
21 } | 20 } |
22 | 21 |
23 void polymerCreated() { | 22 void polymerCreated() { |
24 // Use a cache for js proxy values. | |
25 useCache = true; | |
26 jsElement.callMethod('originalPolymerCreatedCallback'); | 23 jsElement.callMethod('originalPolymerCreatedCallback'); |
27 } | 24 } |
| 25 |
| 26 |
28 } | 27 } |
OLD | NEW |