aboutsummaryrefslogtreecommitdiffstats
path: root/test/suite/sputnik_converted/15_Native/15.3_Function_Objects/15.3.5_Properties_of_Function_Instances/S15.3.5.3_A3_T1.js
blob: ad3209da58167360624a57f46a427eaed500b9df (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
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/**
* @name: S15.3.5.3_A3_T1;
* @section: 15.3.5.3, 11.8.6;
* @assertion: Assume F is a Function object. When the [[HasInstance]] method of F is called with value V and V is an object, the following steps are taken:
* i) Call the [[Get]] method of F with property name "prototype".
* ii) Let O be Result(i) and O is an object.
* iii) Let V be the value of the [[Prototype]] property of V.
* iv) If V is null, return false.
* v)  If O and V refer to the same object or if they refer to objects joined to each other (13.1.2), return true.
* vi) Go to step iii);
* @description: F.prototype.type is 1, and V is new F;
*/


// Converted for Test262 from original Sputnik source

ES5Harness.registerTest( {
id: "S15.3.5.3_A3_T1",

path: "TestCases/15_Native/15.3_Function_Objects/15.3.5_Properties_of_Function_Instances/S15.3.5.3_A3_T1.js",

assertion: "Assume F is a Function object. When the [[HasInstance]] method of F is called with value V and V is an object, the following steps are taken:",

description: "F.prototype.type is 1, and V is new F",

test: function testcase() {
   FACTORY = Function("this.name=\"root\"");

FACTORY.prototype.type=1;

instance = new FACTORY;

//CHECK#1
if (!(instance instanceof FACTORY)) {
  $ERROR('#1: If O and V refer to the same object or if they refer to objects joined to each other (13.1.2), return true');
}

 }
});