mirror of
https://github.com/tc39/test262.git
synced 2025-08-28 13:28:38 +02:00
23 lines
640 B
JavaScript
23 lines
640 B
JavaScript
// Copyright 2011 Google Inc. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/**
|
|
* @path ch08/8.6/8.6.2/S8.6.2_A8.js
|
|
* @description It should not be possible to change the [[Prototype]]
|
|
* of a non-extensible object
|
|
*/
|
|
|
|
var x = Object.preventExtensions({});
|
|
var y = {};
|
|
try {
|
|
x.__proto__ = y;
|
|
} catch (err) {
|
|
// As far as this test is concerned, we allow the above assignment
|
|
// to fail. This failure does violate the spec and should probably
|
|
// be tested separately.
|
|
}
|
|
if (Object.getPrototypeOf(x) !== Object.prototype) {
|
|
$ERROR("Prototype of non-extensible object mutated");
|
|
}
|
|
|