You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
124 lines
4.6 KiB
JavaScript
124 lines
4.6 KiB
JavaScript
/*!
|
|
* https://github.com/es-shims/es5-shim
|
|
* @license es5-shim Copyright 2009-2014 by contributors, MIT License
|
|
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
|
|
*/
|
|
|
|
// vim: ts=4 sts=4 sw=4 expandtab
|
|
|
|
//Add semicolon to prevent IIFE from being passed as argument to concated code.
|
|
;
|
|
|
|
// UMD (Universal Module Definition)
|
|
// see https://github.com/umdjs/umd/blob/master/returnExports.js
|
|
(function (root, factory) {
|
|
'use strict';
|
|
/*global define, exports, module */
|
|
if (typeof define === 'function' && define.amd) {
|
|
// AMD. Register as an anonymous module.
|
|
define(factory);
|
|
} else if (typeof exports === 'object') {
|
|
// Node. Does not work with strict CommonJS, but
|
|
// only CommonJS-like enviroments that support module.exports,
|
|
// like Node.
|
|
module.exports = factory();
|
|
} else {
|
|
// Browser globals (root is window)
|
|
root.returnExports = factory();
|
|
}
|
|
}(this, function () {
|
|
|
|
|
|
// papaparse.js에서 Object.create 함수를 쓰기 때문에 es5-sham.js의 Object.create 함수만 사용함.
|
|
|
|
// ES5 15.2.3.5
|
|
// http://es5.github.com/#x15.2.3.5
|
|
if (!Object.create) {
|
|
|
|
// Contributed by Brandon Benvie, October, 2012
|
|
var createEmpty;
|
|
var supportsProto = !({ __proto__: null } instanceof Object);
|
|
// the following produces false positives
|
|
// in Opera Mini => not a reliable check
|
|
// Object.prototype.__proto__ === null
|
|
/*global document */
|
|
if (supportsProto || typeof document === 'undefined') {
|
|
createEmpty = function () {
|
|
return { __proto__: null };
|
|
};
|
|
} else {
|
|
// In old IE __proto__ can't be used to manually set `null`, nor does
|
|
// any other method exist to make an object that inherits from nothing,
|
|
// aside from Object.prototype itself. Instead, create a new global
|
|
// object and *steal* its Object.prototype and strip it bare. This is
|
|
// used as the prototype to create nullary objects.
|
|
createEmpty = function () {
|
|
var iframe = document.createElement('iframe');
|
|
var parent = document.body || document.documentElement;
|
|
iframe.style.display = 'none';
|
|
parent.appendChild(iframe);
|
|
/*eslint-disable no-script-url */
|
|
iframe.src = 'javascript:';
|
|
/*eslint-enable no-script-url */
|
|
var empty = iframe.contentWindow.Object.prototype;
|
|
parent.removeChild(iframe);
|
|
iframe = null;
|
|
delete empty.constructor;
|
|
delete empty.hasOwnProperty;
|
|
delete empty.propertyIsEnumerable;
|
|
delete empty.isPrototypeOf;
|
|
delete empty.toLocaleString;
|
|
delete empty.toString;
|
|
delete empty.valueOf;
|
|
/*eslint-disable no-proto */
|
|
empty.__proto__ = null;
|
|
/*eslint-enable no-proto */
|
|
|
|
function Empty() {}
|
|
Empty.prototype = empty;
|
|
// short-circuit future calls
|
|
createEmpty = function () {
|
|
return new Empty();
|
|
};
|
|
return new Empty();
|
|
};
|
|
}
|
|
|
|
Object.create = function create(prototype, properties) {
|
|
|
|
var object;
|
|
function Type() {} // An empty constructor.
|
|
|
|
if (prototype === null) {
|
|
object = createEmpty();
|
|
} else {
|
|
if (typeof prototype !== 'object' && typeof prototype !== 'function') {
|
|
// In the native implementation `parent` can be `null`
|
|
// OR *any* `instanceof Object` (Object|Function|Array|RegExp|etc)
|
|
// Use `typeof` tho, b/c in old IE, DOM elements are not `instanceof Object`
|
|
// like they are in modern browsers. Using `Object.create` on DOM elements
|
|
// is...err...probably inappropriate, but the native version allows for it.
|
|
throw new TypeError('Object prototype may only be an Object or null'); // same msg as Chrome
|
|
}
|
|
Type.prototype = prototype;
|
|
object = new Type();
|
|
// IE has no built-in implementation of `Object.getPrototypeOf`
|
|
// neither `__proto__`, but this manually setting `__proto__` will
|
|
// guarantee that `Object.getPrototypeOf` will work as expected with
|
|
// objects created using `Object.create`
|
|
/*eslint-disable no-proto */
|
|
object.__proto__ = prototype;
|
|
/*eslint-enable no-proto */
|
|
}
|
|
|
|
if (properties !== void 0) {
|
|
Object.defineProperties(object, properties);
|
|
}
|
|
|
|
return object;
|
|
};
|
|
}
|
|
|
|
|
|
}));
|