mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Keep createObject fallback for modern builds.
This commit is contained in:
11
dist/lodash.js
vendored
11
dist/lodash.js
vendored
@@ -1332,6 +1332,17 @@
|
||||
function createObject(prototype) {
|
||||
return isObject(prototype) ? nativeCreate(prototype) : {};
|
||||
}
|
||||
// fallback for browsers without `Object.create`
|
||||
if (!nativeCreate) {
|
||||
createObject = function(prototype) {
|
||||
if (isObject(prototype)) {
|
||||
noop.prototype = prototype;
|
||||
var result = new noop;
|
||||
noop.prototype = null;
|
||||
}
|
||||
return result || {};
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by `escape` to convert characters to HTML entities.
|
||||
|
||||
Reference in New Issue
Block a user