OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 21603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21614 THREADED_TEST(JSONParseNumber) { | 21614 THREADED_TEST(JSONParseNumber) { |
21615 LocalContext context; | 21615 LocalContext context; |
21616 HandleScope scope(context->GetIsolate()); | 21616 HandleScope scope(context->GetIsolate()); |
21617 Local<Value> obj = v8::JSON::Parse(v8_str("42")); | 21617 Local<Value> obj = v8::JSON::Parse(v8_str("42")); |
21618 Handle<Object> global = context->Global(); | 21618 Handle<Object> global = context->Global(); |
21619 global->Set(v8_str("obj"), obj); | 21619 global->Set(v8_str("obj"), obj); |
21620 ExpectString("JSON.stringify(obj)", "42"); | 21620 ExpectString("JSON.stringify(obj)", "42"); |
21621 } | 21621 } |
21622 | 21622 |
21623 | 21623 |
21624 #if V8_OS_POSIX | 21624 #if V8_OS_POSIX && !V8_OS_NACL |
21625 class ThreadInterruptTest { | 21625 class ThreadInterruptTest { |
21626 public: | 21626 public: |
21627 ThreadInterruptTest() : sem_(0), sem_value_(0) { } | 21627 ThreadInterruptTest() : sem_(0), sem_value_(0) { } |
21628 ~ThreadInterruptTest() {} | 21628 ~ThreadInterruptTest() {} |
21629 | 21629 |
21630 void RunTest() { | 21630 void RunTest() { |
21631 InterruptThread i_thread(this); | 21631 InterruptThread i_thread(this); |
21632 i_thread.Start(); | 21632 i_thread.Start(); |
21633 | 21633 |
21634 sem_.Wait(); | 21634 sem_.Wait(); |
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
22993 desc = x->GetOwnPropertyDescriptor(v8_str("p1")); | 22993 desc = x->GetOwnPropertyDescriptor(v8_str("p1")); |
22994 Local<Function> set = | 22994 Local<Function> set = |
22995 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("set"))); | 22995 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("set"))); |
22996 Local<Function> get = | 22996 Local<Function> get = |
22997 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("get"))); | 22997 Local<Function>::Cast(Local<Object>::Cast(desc)->Get(v8_str("get"))); |
22998 CHECK_EQ(v8_num(13), get->Call(x, 0, NULL)); | 22998 CHECK_EQ(v8_num(13), get->Call(x, 0, NULL)); |
22999 Handle<Value> args[] = { v8_num(14) }; | 22999 Handle<Value> args[] = { v8_num(14) }; |
23000 set->Call(x, 1, args); | 23000 set->Call(x, 1, args); |
23001 CHECK_EQ(v8_num(14), get->Call(x, 0, NULL)); | 23001 CHECK_EQ(v8_num(14), get->Call(x, 0, NULL)); |
23002 } | 23002 } |
OLD | NEW |