| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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:html'; | 6 import 'dart:html'; |
| 7 import 'dart:js'; | 7 import 'dart:js'; |
| 8 import 'package:polymer_interop/polymer_interop.dart' show Polymer, PolymerDom; | 8 import 'package:polymer_interop/polymer_interop.dart' show Polymer, PolymerDom; |
| 9 import 'package:web_components/web_components.dart'; |
| 9 import 'js_proxy.dart'; | 10 import 'js_proxy.dart'; |
| 10 | 11 |
| 11 | 12 |
| 12 /// Basic api for re-using the polymer js prototypes. | 13 /// Basic api for re-using the polymer js prototypes. |
| 13 abstract class PolymerMixin implements JsProxy { | 14 abstract class PolymerMixin implements JsProxy, CustomElementProxyMixin { |
| 14 JsObject _proxy; | 15 JsObject _proxy; |
| 15 | 16 |
| 16 JsObject get jsElement { | 17 JsObject get jsElement { |
| 17 if (_proxy == null) { | 18 if (_proxy == null) { |
| 18 _proxy = new JsObject.fromBrowserObject(this); | 19 _proxy = new JsObject.fromBrowserObject(this); |
| 19 _proxy['__data__'] = jsProxy; | 20 _proxy['__data__'] = jsProxy; |
| 20 } | 21 } |
| 21 return _proxy; | 22 return _proxy; |
| 22 } | 23 } |
| 23 | 24 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 throw 'All elements on path $path must be annoted with ' | 214 throw 'All elements on path $path must be annoted with ' |
| 214 '@jsProxyReflectable, `${parts.length[i - 1]}` was not.'; | 215 '@jsProxyReflectable, `${parts.length[i - 1]}` was not.'; |
| 215 } | 216 } |
| 216 obj = mirror.invokeGetter(parts[i]); | 217 obj = mirror.invokeGetter(parts[i]); |
| 217 } | 218 } |
| 218 return obj; | 219 return obj; |
| 219 } | 220 } |
| 220 } | 221 } |
| 221 | 222 |
| 222 class Foo extends Object with Polymer, Polymer, Polymer {} | 223 class Foo extends Object with Polymer, Polymer, Polymer {} |
| OLD | NEW |