!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/queuepro/node_modules/define-properties/test/   drwxrwxr-x
Free 12.96 GB of 57.97 GB (22.35%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     index.js (2.99 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
'use strict';

var define = require('../');
var test = require('tape');
var keys = require('object-keys');

var arePropertyDescriptorsSupported = function () {
	var obj = { a: 1 };
	try {
		Object.defineProperty(obj, 'x', { value: obj });
		return obj.x === obj;
	} catch (e) { /* this is IE 8. */
		return false;
	}
};
var descriptorsSupported = !!Object.defineProperty && arePropertyDescriptorsSupported();

var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';

test('defineProperties', function (dt) {
	dt.test('with descriptor support', { skip: !descriptorsSupported }, function (t) {
		var getDescriptor = function (value) {
			return {
				configurable: true,
				enumerable: false,
				value: value,
				writable: true
			};
		};

		var obj = {
			a: 1,
			b: 2,
			c: 3
		};
		t.deepEqual(keys(obj), ['a', 'b', 'c'], 'all literal-set keys start enumerable');
		define(obj, {
			b: 3,
			c: 4,
			d: 5
		});
		t.deepEqual(obj, {
			a: 1,
			b: 2,
			c: 3
		}, 'existing properties were not overridden');
		t.deepEqual(Object.getOwnPropertyDescriptor(obj, 'd'), getDescriptor(5), 'new property "d" was added and is not enumerable');
		t.deepEqual(['a', 'b', 'c'], keys(obj), 'new keys are not enumerable');

		define(obj, {
			a: 2,
			b: 3,
			c: 4
		}, {
			a: function () { return true; },
			b: function () { return false; }
		});
		t.deepEqual(obj, {
			b: 2,
			c: 3
		}, 'properties only overriden when predicate exists and returns true');
		t.deepEqual(Object.getOwnPropertyDescriptor(obj, 'd'), getDescriptor(5), 'existing property "d" remained and is not enumerable');
		t.deepEqual(Object.getOwnPropertyDescriptor(obj, 'a'), getDescriptor(2), 'existing property "a" was overridden and is not enumerable');
		t.deepEqual(['b', 'c'], keys(obj), 'overridden keys are not enumerable');

		t.end();
	});

	dt.test('without descriptor support', { skip: descriptorsSupported }, function (t) {
		var obj = {
			a: 1,
			b: 2,
			c: 3
		};
		define(obj, {
			b: 3,
			c: 4,
			d: 5
		});
		t.deepEqual(obj, {
			a: 1,
			b: 2,
			c: 3,
			d: 5
		}, 'existing properties were not overridden, new properties were added');

		define(obj, {
			a: 2,
			b: 3,
			c: 4
		}, {
			a: function () { return true; },
			b: function () { return false; }
		});
		t.deepEqual(obj, {
			a: 2,
			b: 2,
			c: 3,
			d: 5
		}, 'properties only overriden when predicate exists and returns true');

		t.end();
	});

	dt.end();
});

test('symbols', { skip: !hasSymbols }, function (t) {
	var sym = Symbol('foo');
	var obj = {};
	var aValue = {};
	var bValue = {};
	var properties = { a: aValue };
	properties[sym] = bValue;

	define(obj, properties);

	t.deepEqual(Object.keys(obj), [], 'object has no enumerable keys');
	t.deepEqual(Object.getOwnPropertyNames(obj), ['a'], 'object has non-enumerable "a" key');
	t.deepEqual(Object.getOwnPropertySymbols(obj), [sym], 'object has non-enumerable symbol key');
	t.equal(obj.a, aValue, 'string keyed value is defined');
	t.equal(obj[sym], bValue, 'symbol keyed value is defined');

	t.end();
});

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0134 ]--