test262/test/suite/ch15/15.5/15.5.4/15.5.4.16/S15.5.4.16_A10.js
2011-10-03 13:04:52 -07:00

31 lines
1.3 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.toLowerCase.length property has the attribute ReadOnly
*
* @path ch15/15.5/15.5.4/15.5.4.16/S15.5.4.16_A10.js
* @description Checking if varying the String.prototype.toLowerCase.length property fails
*/
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (!(String.prototype.toLowerCase.hasOwnProperty('length'))) {
$FAIL('#1: String.prototype.toLowerCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toLowerCase.hasOwnProperty('length'));
}
//
//////////////////////////////////////////////////////////////////////////////
var __obj = String.prototype.toLowerCase.length;
String.prototype.toLowerCase.length = function(){return "shifted";};
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (String.prototype.toLowerCase.length !== __obj) {
$ERROR('#2: __obj = String.prototype.toLowerCase.length; String.prototype.toLowerCase.length = function(){return "shifted";}; String.prototype.toLowerCase.length === __obj. Actual: '+String.prototype.toLowerCase.length );
}
//
//////////////////////////////////////////////////////////////////////////////