aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite/sputnik_converted/15_Native/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A3.js
blob: 488884b50fb29ab052f9ea7df781bc4ff6340198 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
* @name: S15.5.5.1_A3;
* @section: 15.5.5.1;
* @assertion: length property has the attributes {DontDelete};
* @description: Checking if deleting the length property of String fails;
*/


// Converted for Test262 from original Sputnik source

ES5Harness.registerTest( {
id: "S15.5.5.1_A3",

path: "TestCases/15_Native/15.5_String_Objects/15.5.5_Properties_of_String_Instances/S15.5.5.1_A3.js",

assertion: "length property has the attributes {DontDelete}",

description: "Checking if deleting the length property of String fails",

test: function testcase() {
   var __str__instance = new String("globglob");

//////////////////////////////////////////////////////////////////////////////
//CHECK#1
if (!(__str__instance.hasOwnProperty("length"))) {
  $ERROR('#1: var __str__instance = new String("globglob"); __str__instance.hasOwnProperty("length") return true. Actual: '+__str__instance.hasOwnProperty("length"));
}
//
//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if (delete __str__instance === true) {
  $ERROR('#2: var __str__instance = new String("globglob"); delete __str__instance !== true');
}
//
//////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////////////
//CHECK#3
if (!(__str__instance.hasOwnProperty("length"))) {
  $ERROR('#3: var __str__instance = new String("globglob"); delete __str__instance; __str__instance.hasOwnProperty("length") return true. Actual: '+__str__instance.hasOwnProperty("length"));
}
//
//////////////////////////////////////////////////////////////////////////////

 }
});