2016-02-01 10:45:23 +01:00
|
|
|
// Copyright (C) 2016 Jordan Harband. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
|
|
|
/*---
|
|
|
|
description: >
|
|
|
|
Object.getOwnPropertyDescriptors should not have its behavior impacted by modifications to the global property Object
|
2016-05-30 16:43:16 +02:00
|
|
|
esid: sec-object.getownpropertydescriptors
|
2016-02-01 10:45:23 +01:00
|
|
|
author: Jordan Harband
|
|
|
|
---*/
|
|
|
|
|
|
|
|
function fakeObject() {
|
|
|
|
$ERROR('The overriden version of Object was called!');
|
|
|
|
}
|
|
|
|
fakeObject.getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors;
|
|
|
|
fakeObject.keys = Object.keys;
|
|
|
|
|
2016-04-22 19:07:00 +02:00
|
|
|
var global = this;
|
2016-02-01 10:45:23 +01:00
|
|
|
global.Object = fakeObject;
|
|
|
|
|
|
|
|
assert.sameValue(Object, fakeObject, 'Sanity check failed: could not modify the global Object');
|
|
|
|
assert.sameValue(Object.keys(Object.getOwnPropertyDescriptors('a')).length, 2, 'Expected string primitive to have 2 descriptors');
|