mirror of
https://github.com/jlengrand/webcomponentsjs.git
synced 2026-03-10 08:51:22 +00:00
move ES6 polyfills into lang
This commit is contained in:
@@ -5,7 +5,11 @@
|
||||
"../MutationObserver/MutationObserver.js",
|
||||
"../Template/Template.js",
|
||||
"../HTMLImports/build.json",
|
||||
"../CustomElements/build.json",
|
||||
"Promise.js",
|
||||
"../../custom-elements/custom-elements.min.js",
|
||||
"../../shadydom/shadydom.min.js",
|
||||
"../../shadycss/shadycss.min.js",
|
||||
"lang.js",
|
||||
"dom.js",
|
||||
"unresolved.js"
|
||||
]
|
||||
|
||||
@@ -128,31 +128,4 @@
|
||||
window.MouseEvent.prototype = origMouseEvent.prototype;
|
||||
}
|
||||
|
||||
if (!Array.from) {
|
||||
Array.from = function (object) {
|
||||
return [].slice.call(object);
|
||||
};
|
||||
}
|
||||
|
||||
if (!Object.assign) {
|
||||
function assign(target, source) {
|
||||
var n$ = Object.getOwnPropertyNames(source);
|
||||
for (var i=0, p; i < n$.length; i++) {
|
||||
p = n$[i];
|
||||
target[p] = source[p];
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign = function(target, sources) {
|
||||
var args = [].slice.call(arguments, 1);
|
||||
for (var i=0, s; i < args.length; i++) {
|
||||
s = args[i];
|
||||
if (s) {
|
||||
assign(target, s);
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
}
|
||||
|
||||
})(window.WebComponents);
|
||||
|
||||
@@ -10,18 +10,47 @@
|
||||
|
||||
(function(scope) {
|
||||
|
||||
// Old versions of iOS do not have bind.
|
||||
'use strict';
|
||||
|
||||
if (!Function.prototype.bind) {
|
||||
Function.prototype.bind = function(scope) {
|
||||
var self = this;
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
return function() {
|
||||
var args2 = args.slice();
|
||||
args2.push.apply(args2, arguments);
|
||||
return self.apply(scope, args2);
|
||||
// Old versions of iOS do not have bind.
|
||||
if (!Function.prototype.bind) {
|
||||
Function.prototype.bind = function(scope) {
|
||||
var self = this;
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
return function() {
|
||||
var args2 = args.slice();
|
||||
args2.push.apply(args2, arguments);
|
||||
return self.apply(scope, args2);
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// ES6 stuff
|
||||
if (!Array.from) {
|
||||
Array.from = function (object) {
|
||||
return [].slice.call(object);
|
||||
};
|
||||
}
|
||||
|
||||
if (!Object.assign) {
|
||||
function assign(target, source) {
|
||||
var n$ = Object.getOwnPropertyNames(source);
|
||||
for (var i=0, p; i < n$.length; i++) {
|
||||
p = n$[i];
|
||||
target[p] = source[p];
|
||||
}
|
||||
}
|
||||
|
||||
Object.assign = function(target, sources) {
|
||||
var args = [].slice.call(arguments, 1);
|
||||
for (var i=0, s; i < args.length; i++) {
|
||||
s = args[i];
|
||||
if (s) {
|
||||
assign(target, s);
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
}
|
||||
|
||||
})(window.WebComponents);
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
'../../shadycss/shadycss.min.js',
|
||||
'WebComponents/post-polyfill.js',
|
||||
// these scripts are loaded here due to polyfill timing issues
|
||||
'WebComponents/lang.js',
|
||||
'WebComponents/dom.js',
|
||||
'WebComponents/unresolved.js'
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user