Sha256: c0c7eb593936f6c27f142b79ed2a6057d8fd10d65603723e96649ed02e82524b

Contents?: true

Size: 694 Bytes

Versions: 243

Compression:

Stored size: 694 Bytes

Contents

'use strict';

var GetIntrinsic = require('get-intrinsic');

var $TypeError = GetIntrinsic('%TypeError%');

var IsPropertyKey = require('./IsPropertyKey');
var Type = require('./Type');

// https://262.ecma-international.org/6.0/#sec-deletepropertyorthrow

module.exports = function DeletePropertyOrThrow(O, P) {
	if (Type(O) !== 'Object') {
		throw new $TypeError('Assertion failed: Type(O) is not Object');
	}

	if (!IsPropertyKey(P)) {
		throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true');
	}

	// eslint-disable-next-line no-param-reassign
	var success = delete O[P];
	if (!success) {
		throw new $TypeError('Attempt to delete property failed.');
	}
	return success;
};

Version data entries

243 entries across 27 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.32 node_modules/es-abstract/2023/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2019/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2018/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2016/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2020/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2015/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2022/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2017/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2021/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2023/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2015/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2021/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2018/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2022/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2019/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2016/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2020/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2017/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.30 node_modules/es-abstract/2023/DeletePropertyOrThrow.js
immosquare-cleaner-0.1.30 node_modules/es-abstract/2015/DeletePropertyOrThrow.js