test262/test/suite/ch15/15.5/15.5.3/S15.5.3.1_A4.js
2011-10-03 13:04:52 -07:00

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