P. 1
ECMA-262 JavaScript 5

ECMA-262 JavaScript 5

|Views: 218|Likes:
Publicado porGregoryDonaghy

More info:

Published by: GregoryDonaghy on Mar 12, 2010
Direitos Autorais:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

08/16/2013

pdf

text

original

Syntax

LogicalANDExpression :
BitwiseORExpression
LogicalANDExpression
&& BitwiseORExpression

LogicalANDExpressionNoIn :
BitwiseORExpressionNoIn
LogicalANDExpressionNoIn
&& BitwiseORExpressionNoIn

82

© Ecma International 2009

LogicalORExpression :
LogicalANDExpression
LogicalORExpression
|| LogicalANDExpression

LogicalORExpressionNoIn :
LogicalANDExpressionNoIn
LogicalORExpressionNoIn
|| LogicalANDExpressionNoIn

Semantics

The production LogicalANDExpression : LogicalANDExpression && BitwiseORExpression is evaluated as follows:

1. Let lref be the result of evaluating LogicalANDExpression.
2. Let lval be GetValue(lref).
3. If ToBoolean(lval) is false, return lval.
4. Let rref be the result of evaluating BitwiseORExpression.
5. Return GetValue(rref).

The production LogicalORExpression : LogicalORExpression || LogicalANDExpression is evaluated as follows:

1. Let lref be the result of evaluating LogicalORExpression.
2. Let lval be GetValue(lref).
3. If ToBoolean(lval) is true, return lval.
4. Let rref be the result of evaluating LogicalANDExpression.
5. Return GetValue(rref).

The LogicalANDExpressionNoIn and LogicalORExpressionNoIn productions are evaluated in the same manner
as the LogicalANDExpression and LogicalORExpression productions except that the contained
LogicalANDExpressionNoIn, BitwiseORExpressionNoIn and LogicalORExpressionNoIn are evaluated instead of the
contained LogicalANDExpression, BitwiseORExpression and LogicalORExpression, respectively.

NOTE

The value produced by a && or || operator is not necessarily of type Boolean. The value produced will always
be the value of one of the two operand expressions.

You're Reading a Free Preview

Descarregar
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->