| | |
| | | 'use strict'; |
| | | var $ = require('../internals/export'); |
| | | var global = require('../internals/global'); |
| | | var uncurryThis = require('../internals/function-uncurry-this'); |
| | | var isForced = require('../internals/is-forced'); |
| | | var redefine = require('../internals/redefine'); |
| | | var defineBuiltIn = require('../internals/define-built-in'); |
| | | var InternalMetadataModule = require('../internals/internal-metadata'); |
| | | var iterate = require('../internals/iterate'); |
| | | var anInstance = require('../internals/an-instance'); |
| | |
| | | var exported = {}; |
| | | |
| | | var fixMethod = function (KEY) { |
| | | var nativeMethod = NativePrototype[KEY]; |
| | | redefine(NativePrototype, KEY, |
| | | var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]); |
| | | defineBuiltIn(NativePrototype, KEY, |
| | | KEY == 'add' ? function add(value) { |
| | | nativeMethod.call(this, value === 0 ? 0 : value); |
| | | uncurriedNativeMethod(this, value === 0 ? 0 : value); |
| | | return this; |
| | | } : KEY == 'delete' ? function (key) { |
| | | return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key); |
| | | return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); |
| | | } : KEY == 'get' ? function get(key) { |
| | | return IS_WEAK && !isObject(key) ? undefined : nativeMethod.call(this, key === 0 ? 0 : key); |
| | | return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key); |
| | | } : KEY == 'has' ? function has(key) { |
| | | return IS_WEAK && !isObject(key) ? false : nativeMethod.call(this, key === 0 ? 0 : key); |
| | | return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); |
| | | } : function set(key, value) { |
| | | nativeMethod.call(this, key === 0 ? 0 : key, value); |
| | | uncurriedNativeMethod(this, key === 0 ? 0 : key, value); |
| | | return this; |
| | | } |
| | | ); |
| | |
| | | |
| | | if (!ACCEPT_ITERABLES) { |
| | | Constructor = wrapper(function (dummy, iterable) { |
| | | anInstance(dummy, Constructor, CONSTRUCTOR_NAME); |
| | | anInstance(dummy, NativePrototype); |
| | | var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor); |
| | | if (iterable != undefined) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); |
| | | return that; |
| | |
| | | } |
| | | |
| | | exported[CONSTRUCTOR_NAME] = Constructor; |
| | | $({ global: true, forced: Constructor != NativeConstructor }, exported); |
| | | $({ global: true, constructor: true, forced: Constructor != NativeConstructor }, exported); |
| | | |
| | | setToStringTag(Constructor, CONSTRUCTOR_NAME); |
| | | |