Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Issue 912002: Add a predicate IsPrimitive to AST Expression nodes. (Closed)

Created:
10 years, 9 months ago by Kevin Millikin (Chromium)
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Add a predicate IsPrimitive to AST Expression nodes. IsPrimitive reflects that an expression's value is known statically to be one of the ECMA-262-3 JS types other than Object (e.g., Undefined, Null, Boolean, String, or Number). The type conversions ToPrimitive, ToNumber, ToInteger, ToInt32, ToUInt32, ToUint16, ToString, or ToObject cannot invoke user code for primitive input values. ToObject throws a TypeError if its input is Undefined or Null. Committed: http://code.google.com/p/v8/source/detail?r=4116

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+142 lines, -0 lines) Patch
M src/ast.h View 24 chunks +50 lines, -0 lines 0 comments Download
M src/ast.cc View 1 chunk +92 lines, -0 lines 1 comment Download

Messages

Total messages: 2 (0 generated)
Kevin Millikin (Chromium)
10 years, 9 months ago (2010-03-12 11:45:31 UTC) #1
Mads Ager (chromium)
10 years, 9 months ago (2010-03-12 12:19:29 UTC) #2
LGTM

http://codereview.chromium.org/912002/diff/1/2
File src/ast.cc (right):

http://codereview.chromium.org/912002/diff/1/2#newcode558
src/ast.cc:558: // Booleans, void Undefined, typeof String (but host objects are
Let's remove the comment about host objects being implementation-dependents.  As
I read the spec, typeof returns a string which can be implementation dependent,
but all that matters here is that it *does* return a string.

Powered by Google App Engine
This is Rietveld 408576698