mirror of
https://github.com/tc39/test262.git
synced 2025-08-28 13:28:38 +02:00
31 lines
974 B
JavaScript
31 lines
974 B
JavaScript
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/**
|
|
* The length property of sort has the attribute DontDelete
|
|
*
|
|
* @path ch15/15.4/15.4.4/15.4.4.11/S15.4.4.11_A7.2.js
|
|
* @description Checking use hasOwnProperty, delete
|
|
* @noStrict
|
|
*/
|
|
|
|
//CHECK#1
|
|
if (Array.prototype.sort.hasOwnProperty('length') !== true) {
|
|
$FAIL('#1: Array.sort.prototype.hasOwnProperty(\'length\') === true. Actual: ' + (Array.sort.prototype.hasOwnProperty('length')));
|
|
}
|
|
|
|
delete Array.prototype.sort.length;
|
|
|
|
//CHECK#2
|
|
if (Array.prototype.sort.hasOwnProperty('length') !== true) {
|
|
$ERROR('#2: delete Array.prototype.sort.length; Array.prototype.sort.hasOwnProperty(\'length\') === true. Actual: ' + (Array.prototype.sort.hasOwnProperty('length')));
|
|
}
|
|
|
|
//CHECK#3
|
|
if (Array.prototype.sort.length === undefined) {
|
|
$ERROR('#3: delete Array.prototype.sort.length; Array.prototype.sort.length !== undefined');
|
|
}
|
|
|
|
|
|
|