Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

object.assign

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object.assign - npm Package Compare versions

Comparing version 4.1.1 to 4.1.2

.nycrc

7

CHANGELOG.md

@@ -0,1 +1,8 @@

4.1.2 / 2020-10-30
==================
* [Refactor] use extracted `call-bind` instead of full `es-abstract`
* [Dev Deps] update `eslint`, `ses`, `browserify`
* [Tests] run tests in SES
* [Tests] ses-compat: show error stacks
4.1.1 / 2020-09-11

@@ -2,0 +9,0 @@ ==================

261

dist/browser.js

@@ -13,3 +13,3 @@ (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){

},{"./":3,"object-keys":16}],2:[function(require,module,exports){
},{"./":3,"object-keys":14}],2:[function(require,module,exports){
'use strict';

@@ -23,3 +23,3 @@

var hasSymbols = require('has-symbols/shams')();
var callBound = require('es-abstract/helpers/callBound');
var callBound = require('call-bind/callBound');
var toObject = Object;

@@ -59,7 +59,7 @@ var $push = callBound('Array.prototype.push');

},{"es-abstract/helpers/callBound":7,"has-symbols/shams":11,"object-keys":16}],3:[function(require,module,exports){
},{"call-bind/callBound":4,"has-symbols/shams":11,"object-keys":14}],3:[function(require,module,exports){
'use strict';
var defineProperties = require('define-properties');
var callBind = require('es-abstract/helpers/callBind');
var callBind = require('call-bind');

@@ -84,5 +84,57 @@ var implementation = require('./implementation');

},{"./implementation":2,"./polyfill":18,"./shim":19,"define-properties":4,"es-abstract/helpers/callBind":6}],4:[function(require,module,exports){
},{"./implementation":2,"./polyfill":16,"./shim":17,"call-bind":5,"define-properties":6}],4:[function(require,module,exports){
'use strict';
var GetIntrinsic = require('get-intrinsic');
var callBind = require('./');
var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
module.exports = function callBoundIntrinsic(name, allowMissing) {
var intrinsic = GetIntrinsic(name, !!allowMissing);
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
return callBind(intrinsic);
}
return intrinsic;
};
},{"./":5,"get-intrinsic":9}],5:[function(require,module,exports){
'use strict';
var bind = require('function-bind');
var GetIntrinsic = require('get-intrinsic');
var $apply = GetIntrinsic('%Function.prototype.apply%');
var $call = GetIntrinsic('%Function.prototype.call%');
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
if ($defineProperty) {
try {
$defineProperty({}, 'a', { value: 1 });
} catch (e) {
// IE 8 has a broken defineProperty
$defineProperty = null;
}
}
module.exports = function callBind() {
return $reflectApply(bind, $call, arguments);
};
var applyBind = function applyBind() {
return $reflectApply(bind, $apply, arguments);
};
if ($defineProperty) {
$defineProperty(module.exports, 'apply', { value: applyBind });
} else {
module.exports.apply = applyBind;
}
},{"function-bind":8,"get-intrinsic":9}],6:[function(require,module,exports){
'use strict';
var keys = require('object-keys');

@@ -145,5 +197,66 @@ var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';

},{"object-keys":16}],5:[function(require,module,exports){
},{"object-keys":14}],7:[function(require,module,exports){
'use strict';
/* eslint no-invalid-this: 1 */
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var slice = Array.prototype.slice;
var toStr = Object.prototype.toString;
var funcType = '[object Function]';
module.exports = function bind(that) {
var target = this;
if (typeof target !== 'function' || toStr.call(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
var args = slice.call(arguments, 1);
var bound;
var binder = function () {
if (this instanceof bound) {
var result = target.apply(
this,
args.concat(slice.call(arguments))
);
if (Object(result) === result) {
return result;
}
return this;
} else {
return target.apply(
that,
args.concat(slice.call(arguments))
);
}
};
var boundLength = Math.max(0, target.length - args.length);
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
boundArgs.push('$' + i);
}
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
if (target.prototype) {
var Empty = function Empty() {};
Empty.prototype = target.prototype;
bound.prototype = new Empty();
Empty.prototype = null;
}
return bound;
};
},{}],8:[function(require,module,exports){
'use strict';
var implementation = require('./implementation');
module.exports = Function.prototype.bind || implementation;
},{"./implementation":7}],9:[function(require,module,exports){
'use strict';
/* globals

@@ -180,3 +293,5 @@ AggregateError,

var throwTypeError = function () { throw new $TypeError(); };
var throwTypeError = function () {
throw new $TypeError();
};
var ThrowTypeError = $gOPD

@@ -413,3 +528,14 @@ ? (function () {

}
value = isOwn ? desc.get || desc.value : value[part];
// By convention, when a data property is converted to an accessor
// property to emulate a data property that does not suffer from
// the override mistake, that accessor's getter is marked with
// an `originalValue` property. Here, when we detect this, we
// uphold the illusion by pretending to see that original data
// property, i.e., returning the value rather than the getter
// itself.
if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
value = desc.get;
} else {
value = value[part];
}
} else {

@@ -428,103 +554,6 @@ isOwn = hasOwn(value, part);

},{"function-bind":9,"has":14,"has-symbols":10}],6:[function(require,module,exports){
},{"function-bind":8,"has":12,"has-symbols":10}],10:[function(require,module,exports){
(function (global){(function (){
'use strict';
var bind = require('function-bind');
var GetIntrinsic = require('../GetIntrinsic');
var $apply = GetIntrinsic('%Function.prototype.apply%');
var $call = GetIntrinsic('%Function.prototype.call%');
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
module.exports = function callBind() {
return $reflectApply(bind, $call, arguments);
};
module.exports.apply = function applyBind() {
return $reflectApply(bind, $apply, arguments);
};
},{"../GetIntrinsic":5,"function-bind":9}],7:[function(require,module,exports){
'use strict';
var GetIntrinsic = require('../GetIntrinsic');
var callBind = require('./callBind');
var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
module.exports = function callBoundIntrinsic(name, allowMissing) {
var intrinsic = GetIntrinsic(name, !!allowMissing);
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) {
return callBind(intrinsic);
}
return intrinsic;
};
},{"../GetIntrinsic":5,"./callBind":6}],8:[function(require,module,exports){
'use strict';
/* eslint no-invalid-this: 1 */
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
var slice = Array.prototype.slice;
var toStr = Object.prototype.toString;
var funcType = '[object Function]';
module.exports = function bind(that) {
var target = this;
if (typeof target !== 'function' || toStr.call(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
var args = slice.call(arguments, 1);
var bound;
var binder = function () {
if (this instanceof bound) {
var result = target.apply(
this,
args.concat(slice.call(arguments))
);
if (Object(result) === result) {
return result;
}
return this;
} else {
return target.apply(
that,
args.concat(slice.call(arguments))
);
}
};
var boundLength = Math.max(0, target.length - args.length);
var boundArgs = [];
for (var i = 0; i < boundLength; i++) {
boundArgs.push('$' + i);
}
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
if (target.prototype) {
var Empty = function Empty() {};
Empty.prototype = target.prototype;
bound.prototype = new Empty();
Empty.prototype = null;
}
return bound;
};
},{}],9:[function(require,module,exports){
'use strict';
var implementation = require('./implementation');
module.exports = Function.prototype.bind || implementation;
},{"./implementation":8}],10:[function(require,module,exports){
(function (global){
'use strict';
var origSymbol = global.Symbol;

@@ -542,3 +571,3 @@ var hasSymbolSham = require('./shams');

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
}).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./shams":11}],11:[function(require,module,exports){

@@ -589,6 +618,2 @@ 'use strict';

},{}],12:[function(require,module,exports){
arguments[4][8][0].apply(exports,arguments)
},{"dup":8}],13:[function(require,module,exports){
arguments[4][9][0].apply(exports,arguments)
},{"./implementation":12,"dup":9}],14:[function(require,module,exports){
'use strict';

@@ -600,3 +625,3 @@

},{"function-bind":13}],15:[function(require,module,exports){
},{"function-bind":8}],13:[function(require,module,exports){
'use strict';

@@ -725,3 +750,3 @@

},{"./isArguments":17}],16:[function(require,module,exports){
},{"./isArguments":15}],14:[function(require,module,exports){
'use strict';

@@ -760,3 +785,3 @@

},{"./implementation":15,"./isArguments":17}],17:[function(require,module,exports){
},{"./implementation":13,"./isArguments":15}],15:[function(require,module,exports){
'use strict';

@@ -780,3 +805,3 @@

},{}],18:[function(require,module,exports){
},{}],16:[function(require,module,exports){
'use strict';

@@ -838,3 +863,3 @@

},{"./implementation":2}],19:[function(require,module,exports){
},{"./implementation":2}],17:[function(require,module,exports){
'use strict';

@@ -855,2 +880,2 @@

},{"./polyfill":18,"define-properties":4}]},{},[1]);
},{"./polyfill":16,"define-properties":6}]},{},[1]);

@@ -9,3 +9,3 @@ 'use strict';

var hasSymbols = require('has-symbols/shams')();
var callBound = require('es-abstract/helpers/callBound');
var callBound = require('call-bind/callBound');
var toObject = Object;

@@ -12,0 +12,0 @@ var $push = callBound('Array.prototype.push');

'use strict';
var defineProperties = require('define-properties');
var callBind = require('es-abstract/helpers/callBind');
var callBind = require('call-bind');

@@ -6,0 +6,0 @@ var implementation = require('./implementation');

{
"name": "object.assign",
"version": "4.1.1",
"version": "4.1.2",
"author": "Jordan Harband",

@@ -12,11 +12,10 @@ "funding": {

"scripts": {
"pretest": "npm run --silent lint && es-shim-api --bound",
"test": "npm run --silent tests-only && npm run test:ses",
"pretest": "npm run lint && es-shim-api --bound",
"test": "npm run tests-only && npm run test:ses",
"posttest": "aud --production",
"tests-only": "npm run --silent test:implementation && npm run --silent test:shim",
"test:native": "node test/native",
"test:shim": "node test/shimmed",
"test:implementation": "node test",
"tests-only": "npm run test:implementation && npm run test:shim",
"test:native": "nyc node test/native",
"test:shim": "nyc node test/shimmed",
"test:implementation": "nyc node test",
"test:ses": "node test/ses-compat",
"coverage": "covert test/*.js",
"lint": "eslint .",

@@ -44,4 +43,4 @@ "build": "mkdir -p dist && browserify browserShim.js > dist/browser.js",

"dependencies": {
"call-bind": "^1.0.0",
"define-properties": "^1.1.3",
"es-abstract": "^1.18.0-next.0",
"has-symbols": "^1.0.1",

@@ -54,5 +53,4 @@ "object-keys": "^1.1.1"

"aud": "^1.1.2",
"browserify": "^16.5.0",
"covert": "^1.1.1",
"eslint": "^7.8.1",
"browserify": "^16.5.2",
"eslint": "^7.12.1",
"for-each": "^0.3.3",

@@ -62,4 +60,5 @@ "functions-have-names": "^1.2.1",

"is": "^3.3.0",
"nyc": "^10.3.2",
"safe-publish-latest": "^1.1.4",
"ses": "^0.10.3",
"ses": "^0.10.4",
"tape": "^5.0.1"

@@ -66,0 +65,0 @@ },

'use strict';
/* globals lockdown */
// requiring ses exposes "lockdown" on the global
require('ses');
/*
* lockdown freezes the primordials
* disabling the error taming makes debugging much easier
* lockdown({ errorTaming: 'unsafe' });
*/
// eslint-disable-next-line no-undef
lockdown();
// lockdown freezes the primordials
lockdown({ errorTaming: 'unsafe' });
// initialize the module
require('..');
require('./');

@@ -162,3 +162,3 @@ 'use strict';

t.test('does not fail when symbols are not present', function (st) {
t.test('does not fail when symbols are not present', { skip: !Object.isFrozen || Object.isFrozen(Object) }, function (st) {
var getSyms;

@@ -165,0 +165,0 @@ if (hasSymbols) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc