mirror of
https://github.com/tc39/test262.git
synced 2025-08-28 21:38:26 +02:00
28 lines
690 B
JavaScript
28 lines
690 B
JavaScript
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/**
|
|
* The RegExp instance global property has the attribute ReadOnly
|
|
*
|
|
* @path ch15/15.10/15.10.7/15.10.7.2/S15.10.7.2_A10.js
|
|
* @description Checking if varying the global property fails
|
|
*/
|
|
|
|
__re = /^|^/;
|
|
|
|
//CHECK#1
|
|
if (__re.hasOwnProperty('global') !== true) {
|
|
$FAIL('#1: __re = /^|^/; __re.hasOwnProperty(\'global\') === true');
|
|
}
|
|
|
|
__obj = __re.global;
|
|
|
|
__re.global = "shifted";
|
|
|
|
//CHECK#2
|
|
if (__re.global !== __obj) {
|
|
$ERROR('#2: __re = /^|^/; __obj = __re.global; __re.global = "shifted"; __re.global === __obj. Actual: ' + (__re.global));
|
|
}
|
|
|
|
|