Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(120)

Issue 14107: Issue 880: Rename Operator.IDENTITY as Operator.TO_NUMBER (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
17 years, 1 month ago by MikeSamuel
Modified:
16 years, 8 months ago
Reviewers:
MarkM
CC:
google-caja-discuss_googlegroups.com
Base URL:
http://google-caja.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Renamed Operator.IDENTITY to Operator.TO_NUMBER. There is only one use, since the parser looks up operators by symbol, and the only other code that uses the name IDENTITY is in the pending array optimization branch. From http://code.google.com/p/google-caja/issues/detail?id=880 The unary + operator is represented in the Operator enum by IDENTITY. This operator does not act as the identity function. ES3 Chapter 11.4.6 defines the operator as applying the primitive ToNumber operation to its operand and yielding the result: 11.4.6 Unary + Operator The unary + operator converts its operand to Number type. The production UnaryExpression : + UnaryExpression is evaluated as follows: 1. Evaluate UnaryExpression. 2. Call GetValue(Result(1)). 3. Call ToNumber(Result(2)). 4. Return Result(3).

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M src/com/google/caja/parser/js/Operator.java View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3
MikeSamuel
17 years, 1 month ago (2009-02-17 21:44:09 UTC) #1
MarkM
LGTM
17 years, 1 month ago (2009-02-17 21:48:34 UTC) #2
MikeSamuel
17 years, 1 month ago (2009-02-17 22:02:30 UTC) #3
@3261
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b