blob: 4a4215f542bb18466626e737ee5a776811a6f5c7 (
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
|
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S15.2.4.5_A1_T1;
* @section: 15.2.4.5;
* @assertion: When the hasOwnProperty method is called with argument V, the following steps are taken:
* i) Let O be this object
* ii) Call ToString(V)
* iii) If O doesn't have a property with the name given by Result(ii), return false
* iv) Return true;
* @description: Checking type of the Object.prototype.hasOwnProperty and the returned result;
*/
// Converted for Test262 from original Sputnik source
ES5Harness.registerTest( {
id: "S15.2.4.5_A1_T1",
path: "TestCases/15_Native/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.5_Object.prototype.hasOwnProperty/S15.2.4.5_A1_T1.js",
assertion: "When the hasOwnProperty method is called with argument V, the following steps are taken:",
description: "Checking type of the Object.prototype.hasOwnProperty and the returned result",
test: function testcase() {
//CHECK#1
if (typeof Object.prototype.hasOwnProperty !== "function") {
$ERROR('#1: hasOwnProperty method is defined');
}
//CHECK#2
if (!(Object.prototype.hasOwnProperty("hasOwnProperty"))) {
$ERROR('#2: hasOwnProperty method works properly');
}
//
}
});
|