2011-09-07 08:35:18 +02:00
|
|
|
// Copyright 2009 the Sputnik authors. All rights reserved.
|
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
|
2014-07-22 01:09:02 +02:00
|
|
|
/*---
|
2018-01-05 18:26:51 +01:00
|
|
|
info: |
|
2014-07-22 01:09:02 +02:00
|
|
|
The production IterationStatement: "for (var VariableDeclarationNoIn in
|
|
|
|
Expression) Statement"
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 12.6.4_A6.1
|
2014-07-22 01:09:02 +02:00
|
|
|
description: >
|
|
|
|
Using Object with custom prototype as an Expression is
|
|
|
|
appropriate. The prototype is "{feat:2,hint:"protohint"}"
|
|
|
|
---*/
|
2011-09-07 08:35:18 +02:00
|
|
|
|
2014-08-05 17:38:52 +02:00
|
|
|
var __accum;
|
|
|
|
|
2011-09-07 08:35:18 +02:00
|
|
|
function FACTORY(){this.prop=1;this.hint="hinted"};
|
|
|
|
|
|
|
|
FACTORY.prototype = {feat:2,hint:"protohint"};
|
|
|
|
|
|
|
|
var __instance = new FACTORY;
|
|
|
|
|
|
|
|
__accum="";
|
|
|
|
|
|
|
|
for (var key in __instance){
|
|
|
|
__accum+=(key + __instance[key]);
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//CHECK#1
|
|
|
|
if (!((__accum.indexOf("prop1")!==-1)&&(__accum.indexOf("feat2")!==-1)&&(__accum.indexOf("hinthinted")!==-1))) {
|
2021-07-22 21:58:54 +02:00
|
|
|
throw new Test262Error('#1: (__accum.indexOf("prop1")!==-1)&&(__accum.indexOf("feat2")!==-1)&&(__accum.indexOf("hinthinted")!==-1)');
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//CHECK#2
|
|
|
|
if (__accum.indexOf("hintprotohint")!==-1) {
|
2021-07-22 21:58:54 +02:00
|
|
|
throw new Test262Error('#2: __accum.indexOf("hintprotohint") === -1. Actual: __accum.indexOf("hintprotohint") ==='+ __accum.indexOf("hintprotohint") );
|
2011-09-07 08:35:18 +02:00
|
|
|
}
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|