summaryrefslogtreecommitdiff
path: root/external/contributions/Google/sputnik_conformance_modified/15_Native/15.2_Object_Objects/15.2.4_Properties_of_the_Object_Prototype_Object/15.2.4.7_Object.prototype.propertyIsEnumerable/S15.2.4.7_A1_T1.js
blob: 1b1fec2dea68965cb4c40fc96308c18f3d9af8f5 (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
// 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.7_A1_T1;
* @section: 15.2.4.7;
* @assertion: The propertyIsEnumerable method does not consider objects in the prototype chain;
* @description: Calling the propertyIsEnumerable method for object in the prototype chain;
*/

//CHECK#1
if (typeof Object.prototype.propertyIsEnumerable !== "function") {
  $ERROR('#1: propertyIsEnumerable method is defined');
}

var proto={rootprop:"avis"};

function AVISFACTORY(name){this.name=name};

AVISFACTORY.prototype = proto;

var seagull= new AVISFACTORY("seagull");

//CHECK#2
if (typeof seagull.propertyIsEnumerable !== "function") {
  $ERROR('#2: propertyIsEnumerable method is accessed');
}

//CHECK#3
if (!(seagull.propertyIsEnumerable("name"))) {
  $ERROR('#3: propertyIsEnumerable method works properly');
}

//CHECK#4
if (seagull.propertyIsEnumerable("rootprop")) {
  $ERROR('#4: propertyIsEnumerable method does not consider objects in the prototype chain');
}
//