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
While evaluating " for ( ExpressionNoIn ; FirstExpression ; SecondExpression )
Statement " , ExpressionNoIn is evaulated first , FirstExpressoin is
evaluated second
2014-07-25 00:41:42 +02:00
es5id : 12.6 . 3_ A3
2014-07-22 01:09:02 +02:00
description : Using "(function(){throw " FirstExpression "})()" as FirstExpression
-- - * /
2011-09-07 08:35:18 +02:00
2014-08-05 17:38:52 +02:00
var _ _in _ _NotInExpression _ _ , _ _in _ _NotInExpression _ _2 , _ _in _ _for ;
2011-09-07 08:35:18 +02:00
//////////////////////////////////////////////////////////////////////////////
//CHECK#1
try {
for ( ( function ( ) { _ _in _ _NotInExpression _ _ = "checked" ; _ _in _ _NotInExpression _ _2 = "passed" ; } ) ( ) ; ( function ( ) { throw "FirstExpression" } ) ( ) ; ( function ( ) { throw "SecondExpression" } ) ( ) ) {
_ _in _ _for = "reached" ;
}
$ERROR ( '#1: (function(){throw "SecondExpression"} lead to throwing exception' ) ;
} catch ( e ) {
if ( e !== "FirstExpression" ) {
$ERROR ( '#1: When for (ExpressionNoIn ; FirstExpression ; SecondExpression) Statement is evaluated first evaluates ExpressionNoIn then FirstExpression' ) ;
}
}
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#2
if ( ( _ _in _ _NotInExpression _ _ !== "checked" ) & ( _ _in _ _NotInExpression _ _2 !== "passed" ) ) {
$ERROR ( '#2: (__in__NotInExpression__ === "checked")&(__in__NotInExpression__2==="passed")' ) ;
}
//
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//CHECK#3
if ( typeof _ _in _ _for !== "undefined" ) {
$ERROR ( '#3: typeof __in__for === "undefined". Actual: typeof __in__for ===' + typeof _ _in _ _for ) ;
}
//
//////////////////////////////////////////////////////////////////////////////