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

Issue 7344013: Expose APIs for detecting boxed primitives, native errors and Math. (Closed)

Created:
9 years, 5 months ago by zarko
Modified:
9 years, 5 months ago
CC:
v8-dev, levin, Dmitry Lomov (no reviews)
Base URL:
git://github.com/v8/v8.git@master
Visibility:
Public.

Description

Expose APIs for detecting boxed primitives, native errors and Math. While implementing structured clone I found that I need support for detecting and creating objects using the builtin Number, String and Boolean constructors; this CL adds this support. I also need to be able to detect entities of "native object type (e.g., Error)", hence the new IsNativeError() calls. (ref: http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#safe-passing-of-structured-data) Patch by Luke Zarko. Committed: http://code.google.com/p/v8/source/detail?r=8653

Patch Set 1 #

Total comments: 8

Patch Set 2 : Respond to comments. #

Patch Set 3 : Fix overlong line. #

Patch Set 4 : Get rid of unclear 'box' comments/strings. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+346 lines, -0 lines) Patch
M include/v8.h View 1 2 3 5 chunks +106 lines, -0 lines 1 comment Download
M src/api.cc View 1 2 3 3 chunks +156 lines, -0 lines 0 comments Download
M test/cctest/test-api.cc View 1 2 1 chunk +84 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
zarko
Please have a look if you get a chance! Thanks, Luke
9 years, 5 months ago (2011-07-12 18:28:01 UTC) #1
Vyacheslav Egorov (Chromium)
Redirecting to Mads. API seems reasonable (and there seems to be no way around introducing ...
9 years, 5 months ago (2011-07-12 18:30:37 UTC) #2
Vyacheslav Egorov (Chromium)
http://codereview.chromium.org/7344013/diff/1/include/v8.h File include/v8.h (right): http://codereview.chromium.org/7344013/diff/1/include/v8.h#newcode937 include/v8.h:937: V8EXPORT bool IsBoxedBoolean() const; Lets call them IsXXXObject instead ...
9 years, 5 months ago (2011-07-12 20:38:12 UTC) #3
zarko
Thanks for the tips! I went back and forth a bit about renaming the locals ...
9 years, 5 months ago (2011-07-12 21:42:06 UTC) #4
Vyacheslav Egorov (Chromium)
9 years, 5 months ago (2011-07-13 09:10:17 UTC) #5
LGTM

I will adjust comments and land.

http://codereview.chromium.org/7344013/diff/3007/include/v8.h
File include/v8.h (right):

http://codereview.chromium.org/7344013/diff/3007/include/v8.h#newcode935
include/v8.h:935: * Returns true if this value is an instance of the Boolean
constructor.
I suggest clearer wording:

"Returns true if this value is XXX object"

notion of XXX object is defined in ECMA-262 (e.g.
http://es5.github.com/#x4.3.15).

Powered by Google App Engine
This is Rietveld 408576698