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

Side by Side Diff: tools/dom/src/dart2js_CustomElementSupport.dart

Issue 23451006: Changing onCreated callback to created. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 part of dart.dom.html; 5 part of dart.dom.html;
6 6
7 _callOnCreated(receiver) { 7 _callCreated(receiver) {
8 return receiver.onCreated(); 8 return receiver.created();
9 } 9 }
10 10
11 _makeCreatedCallbackMethod() { 11 _makeCreatedCallbackMethod() {
12 return JS('', 12 return JS('',
13 '''((function(invokeCallback) { 13 '''((function(invokeCallback) {
14 return function() { 14 return function() {
15 return invokeCallback(this); 15 return invokeCallback(this);
16 }; 16 };
17 })(#))''', 17 })(#))''',
18 convertDartClosureToJS(_callOnCreated, 1)); 18 convertDartClosureToJS(_callCreated, 1));
19 } 19 }
20 20
21 void _registerCustomElement(context, document, String tag, Type type) { 21 void _registerCustomElement(context, document, String tag, Type type) {
22 // Function follows the same pattern as the following JavaScript code for 22 // Function follows the same pattern as the following JavaScript code for
23 // registering a custom element. 23 // registering a custom element.
24 // 24 //
25 // var proto = Object.create(HTMLElement.prototype, { 25 // var proto = Object.create(HTMLElement.prototype, {
26 // createdCallback: { 26 // createdCallback: {
27 // value: function() { 27 // value: function() {
28 // window.console.log('here'); 28 // window.console.log('here');
(...skipping 27 matching lines...) Expand all
56 var baseProto = JS('=Object', '#.prototype', baseConstructor); 56 var baseProto = JS('=Object', '#.prototype', baseConstructor);
57 var proto = JS('=Object', 'Object.create(#, #)', baseProto, properties); 57 var proto = JS('=Object', 'Object.create(#, #)', baseProto, properties);
58 58
59 var interceptor = JS('=Object', '#.prototype', interceptorClass); 59 var interceptor = JS('=Object', '#.prototype', interceptorClass);
60 60
61 setNativeSubclassDispatchRecord(proto, interceptor); 61 setNativeSubclassDispatchRecord(proto, interceptor);
62 62
63 JS('void', '#.register(#, #)', 63 JS('void', '#.register(#, #)',
64 document, tag, JS('', '{prototype: #}', proto)); 64 document, tag, JS('', '{prototype: #}', proto));
65 } 65 }
OLDNEW
« no previous file with comments | « tests/html/custom_elements_test.dart ('k') | tools/dom/templates/html/impl/impl_Element.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698