2011-10-03 13:04:52 -07:00

35 lines
1.4 KiB
JavaScript

// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* The String.prototype.substring.length property has the attribute DontDelete
*
* @path ch15/15.5/15.5.4/15.5.4.15/S15.5.4.15_A9.js
* @description Checking if deleting the String.prototype.substring.length property fails
*/
//////////////////////////////////////////////////////////////////////////////
//CHECK#0
if (!(String.prototype.substring.hasOwnProperty('length'))) {
$FAIL('#0: String.prototype.substring.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.substring.hasOwnProperty('length'));
}
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (delete String.prototype.substring.length) {
$ERROR('#1: delete String.prototype.substring.length return false');
}
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (!(String.prototype.substring.hasOwnProperty('length'))) {
$FAIL('#2: delete String.prototype.substring.length; String.prototype.substring.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.substring.hasOwnProperty('length'));
}
//
//////////////////////////////////////////////////////////////////////////////