mirror of
https://github.com/tc39/test262.git
synced 2025-05-03 14:30:27 +02:00
* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
106 lines
2.5 KiB
JavaScript
106 lines
2.5 KiB
JavaScript
function shouldBe(actual, expected) {
|
|
if (actual !== expected)
|
|
throw new Error('bad value: ' + actual);
|
|
}
|
|
|
|
{
|
|
let name = 'prototype';
|
|
let object = {
|
|
prototype() { },
|
|
get [name]() { },
|
|
};
|
|
|
|
shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, 'prototype')), `{"enumerable":true,"configurable":true}`);
|
|
}
|
|
|
|
{
|
|
let name = 'prototype';
|
|
let object = {
|
|
get [name]() { },
|
|
prototype() { },
|
|
};
|
|
|
|
shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, 'prototype')), `{"writable":true,"enumerable":true,"configurable":true}`);
|
|
}
|
|
|
|
|
|
{
|
|
let name = 'prototype';
|
|
let object = {
|
|
[name]() { },
|
|
get prototype() { },
|
|
};
|
|
|
|
shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, 'prototype')), `{"enumerable":true,"configurable":true}`);
|
|
}
|
|
|
|
{
|
|
let name = 'prototype';
|
|
let object = {
|
|
get prototype() { },
|
|
[name]() { },
|
|
};
|
|
|
|
shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, 'prototype')), `{"writable":true,"enumerable":true,"configurable":true}`);
|
|
}
|
|
|
|
{
|
|
let object = {
|
|
__proto__() { }
|
|
};
|
|
shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, '__proto__')), `{"writable":true,"enumerable":true,"configurable":true}`);
|
|
shouldBe(Object.getPrototypeOf(object), Object.prototype);
|
|
}
|
|
|
|
{
|
|
let name = '__proto__';
|
|
let object = {
|
|
[name]() { }
|
|
};
|
|
shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, '__proto__')), `{"writable":true,"enumerable":true,"configurable":true}`);
|
|
shouldBe(Object.getPrototypeOf(object), Object.prototype);
|
|
}
|
|
|
|
{
|
|
let name = '42';
|
|
let object = {
|
|
42() { },
|
|
get [name]() { },
|
|
};
|
|
|
|
shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, '42')), `{"enumerable":true,"configurable":true}`);
|
|
}
|
|
|
|
{
|
|
let name = '42';
|
|
let object = {
|
|
get [name]() { },
|
|
42() { },
|
|
};
|
|
|
|
shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, '42')), `{"writable":true,"enumerable":true,"configurable":true}`);
|
|
}
|
|
|
|
|
|
{
|
|
let name = '42';
|
|
let object = {
|
|
[name]() { },
|
|
get 42() { },
|
|
};
|
|
|
|
shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, '42')), `{"enumerable":true,"configurable":true}`);
|
|
}
|
|
|
|
{
|
|
let name = '42';
|
|
let object = {
|
|
get 42() { },
|
|
[name]() { },
|
|
};
|
|
|
|
shouldBe(JSON.stringify(Object.getOwnPropertyDescriptor(object, '42')), `{"writable":true,"enumerable":true,"configurable":true}`);
|
|
}
|
|
|
|
|