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

Side by Side Diff: third_party/polymer/v0_8/components-chromium/polymer/src/lib/polymer-bootstrap-extracted.js

Issue 1162563004: Upgrade to 1.0 and switch clients to dom-repeat where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a layout import and remove the gzipped webanimation in reproduce.sh Created 5 years, 6 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
OLDNEW
(Empty)
1
2
3 // until ES6 modules become standard, we follow Occam and simply stake out
4 // a global namespace
5
6 // Polymer is a Function, but of course this is also an Object, so we
7 // hang various other objects off of Polymer.*
8 (function() {
9 var userPolymer = window.Polymer;
10
11 window.Polymer = function(prototype) {
12 var ctor = desugar(prototype);
13 // native Custom Elements treats 'undefined' extends property
14 // as valued, the property must not exist to be ignored
15 var options = {
16 prototype: ctor.prototype
17 };
18 if (prototype.extends) {
19 options.extends = prototype.extends;
20 }
21 Polymer.telemetry._registrate(prototype);
22 document.registerElement(prototype.is, options);
23 return ctor;
24 };
25
26 var desugar = function(prototype) {
27 prototype = Polymer.Base.chainObject(prototype, Polymer.Base);
28 prototype.registerCallback();
29 return prototype.constructor;
30 };
31
32 window.Polymer = Polymer;
33
34 if (userPolymer) {
35 for (var i in userPolymer) {
36 Polymer[i] = userPolymer[i];
37 }
38 }
39
40 Polymer.Class = desugar;
41
42 })();
43 /*
44 // Raw usage
45 [ctor =] Polymer.Class(prototype);
46 document.registerElement(name, ctor);
47
48 // Simplified usage
49 [ctor = ] Polymer(prototype);
50 */
51
52 // telemetry: statistics, logging, and debug
53
54 Polymer.telemetry = {
55 registrations: [],
56 _regLog: function(prototype) {
57 console.log('[' + prototype.is + ']: registered')
58 },
59 _registrate: function(prototype) {
60 this.registrations.push(prototype);
61 Polymer.log && this._regLog(prototype);
62 },
63 dumpRegistrations: function() {
64 this.registrations.forEach(this._regLog);
65 }
66 };
67
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698