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

Side by Side Diff: pkg/web_components/lib/platform.concat.js

Issue 587423002: cherry pick https://github.com/Polymer/ShadowDOM/pull/506 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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
« no previous file with comments | « pkg/web_components/lib/platform.js ('k') | pkg/web_components/lib/platform.concat.js.map » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 2 * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
3 * This code may only be used under the BSD style license found at http://polyme r.github.io/LICENSE.txt 3 * This code may only be used under the BSD style license found at http://polyme r.github.io/LICENSE.txt
4 * The complete set of authors may be found at http://polymer.github.io/AUTHORS. txt 4 * The complete set of authors may be found at http://polymer.github.io/AUTHORS. txt
5 * The complete set of contributors may be found at http://polymer.github.io/CON TRIBUTORS.txt 5 * The complete set of contributors may be found at http://polymer.github.io/CON TRIBUTORS.txt
6 * Code distributed by Google as part of the polymer project is also 6 * Code distributed by Google as part of the polymer project is also
7 * subject to an additional IP rights grant found at http://polymer.github.io/PA TENTS.txt 7 * subject to an additional IP rights grant found at http://polymer.github.io/PA TENTS.txt
8 */ 8 */
9 9
10 window.Platform = window.Platform || {}; 10 window.Platform = window.Platform || {};
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after
2012 try { 2012 try {
2013 return Object.getOwnPropertyDescriptor(source, name); 2013 return Object.getOwnPropertyDescriptor(source, name);
2014 } catch (ex) { 2014 } catch (ex) {
2015 // JSC and V8 both use data properties instead of accessors which can 2015 // JSC and V8 both use data properties instead of accessors which can
2016 // cause getting the property desciptor to throw an exception. 2016 // cause getting the property desciptor to throw an exception.
2017 // https://bugs.webkit.org/show_bug.cgi?id=49739 2017 // https://bugs.webkit.org/show_bug.cgi?id=49739
2018 return dummyDescriptor; 2018 return dummyDescriptor;
2019 } 2019 }
2020 } 2020 }
2021 2021
2022 // Safari 8 exposes WebIDL attributes as an invalid accessor property. Its
2023 // descriptor has {get: undefined, set: undefined}. We therefore ignore the
2024 // shape of the descriptor and make all properties read-write.
2025 // https://bugs.webkit.org/show_bug.cgi?id=49739
2026 var isBrokenSafari = function() {
2027 var descr = Object.getOwnPropertyDescriptor(Node.prototype, 'nodeType');
2028 return !!descr && 'set' in descr;
2029 }();
2030
2022 function installProperty(source, target, allowMethod, opt_blacklist) { 2031 function installProperty(source, target, allowMethod, opt_blacklist) {
2023 var names = getOwnPropertyNames(source); 2032 var names = getOwnPropertyNames(source);
2024 for (var i = 0; i < names.length; i++) { 2033 for (var i = 0; i < names.length; i++) {
2025 var name = names[i]; 2034 var name = names[i];
2026 if (name === 'polymerBlackList_') 2035 if (name === 'polymerBlackList_')
2027 continue; 2036 continue;
2028 2037
2029 if (name in target) 2038 if (name in target)
2030 continue; 2039 continue;
2031 2040
(...skipping 10 matching lines...) Expand all
2042 target[name] = getMethod(name); 2051 target[name] = getMethod(name);
2043 continue; 2052 continue;
2044 } 2053 }
2045 2054
2046 var isEvent = isEventHandlerName(name); 2055 var isEvent = isEventHandlerName(name);
2047 if (isEvent) 2056 if (isEvent)
2048 getter = scope.getEventHandlerGetter(name); 2057 getter = scope.getEventHandlerGetter(name);
2049 else 2058 else
2050 getter = getGetter(name); 2059 getter = getGetter(name);
2051 2060
2052 if (descriptor.writable || descriptor.set) { 2061 if (descriptor.writable || descriptor.set || isBrokenSafari) {
2053 if (isEvent) 2062 if (isEvent)
2054 setter = scope.getEventHandlerSetter(name); 2063 setter = scope.getEventHandlerSetter(name);
2055 else 2064 else
2056 setter = getSetter(name); 2065 setter = getSetter(name);
2057 } 2066 }
2058 2067
2059 defineProperty(target, name, { 2068 defineProperty(target, name, {
2060 get: getter, 2069 get: getter,
2061 set: setter, 2070 set: setter,
2062 configurable: descriptor.configurable, 2071 configurable: descriptor.configurable,
(...skipping 10194 matching lines...) Expand 10 before | Expand all | Expand 10 after
12257 // exports 12266 // exports
12258 12267
12259 scope.marshal = marshal; 12268 scope.marshal = marshal;
12260 // `module` confuses commonjs detectors 12269 // `module` confuses commonjs detectors
12261 scope.modularize = module; 12270 scope.modularize = module;
12262 scope.using = using; 12271 scope.using = using;
12263 12272
12264 })(window); 12273 })(window);
12265 12274
12266 //# sourceMappingURL=platform.concat.js.map 12275 //# sourceMappingURL=platform.concat.js.map
OLDNEW
« no previous file with comments | « pkg/web_components/lib/platform.js ('k') | pkg/web_components/lib/platform.concat.js.map » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698