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

Unified Diff: test/cctest/test-api.cc

Issue 22416003: Make JSON::Parse return Local<Value> (Closed) Base URL: http://v8.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
===================================================================
--- test/cctest/test-api.cc (revision 16081)
+++ test/cctest/test-api.cc (working copy)
@@ -19863,16 +19863,26 @@
}
-THREADED_TEST(JSONParse) {
+THREADED_TEST(JSONParseObject) {
LocalContext context;
HandleScope scope(context->GetIsolate());
- Local<Object> obj = v8::JSON::Parse(v8_str("{\"x\":42}"));
+ Local<Value> obj = v8::JSON::Parse(v8_str("{\"x\":42}"));
Handle<Object> global = context->Global();
global->Set(v8_str("obj"), obj);
ExpectString("JSON.stringify(obj)", "{\"x\":42}");
}
+THREADED_TEST(JSONParseNumber) {
+ LocalContext context;
+ HandleScope scope(context->GetIsolate());
+ Local<Value> obj = v8::JSON::Parse(v8_str("42"));
+ Handle<Object> global = context->Global();
+ global->Set(v8_str("obj"), obj);
+ ExpectString("JSON.stringify(obj)", "42");
+}
+
+
#ifndef WIN32
class ThreadInterruptTest {
public:
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698