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 16636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
16647 v8::ScriptOrigin origin = v8::ScriptOrigin(v8::String::New("test"), | 16647 v8::ScriptOrigin origin = v8::ScriptOrigin(v8::String::New("test"), |
16648 v8::Integer::New(3), v8::Integer::New(2)); | 16648 v8::Integer::New(3), v8::Integer::New(2)); |
16649 v8::Handle<v8::String> scriptSource = v8::String::New( | 16649 v8::Handle<v8::String> scriptSource = v8::String::New( |
16650 "function foo() {}\n\n function bar() {}"); | 16650 "function foo() {}\n\n function bar() {}"); |
16651 v8::Local<v8::Script> script(v8::Script::Compile(scriptSource, &origin)); | 16651 v8::Local<v8::Script> script(v8::Script::Compile(scriptSource, &origin)); |
16652 script->Run(); | 16652 script->Run(); |
16653 v8::Local<v8::Function> foo = v8::Local<v8::Function>::Cast( | 16653 v8::Local<v8::Function> foo = v8::Local<v8::Function>::Cast( |
16654 env->Global()->Get(v8::String::New("foo"))); | 16654 env->Global()->Get(v8::String::New("foo"))); |
16655 v8::Local<v8::Function> bar = v8::Local<v8::Function>::Cast( | 16655 v8::Local<v8::Function> bar = v8::Local<v8::Function>::Cast( |
16656 env->Global()->Get(v8::String::New("bar"))); | 16656 env->Global()->Get(v8::String::New("bar"))); |
16657 CHECK_EQ(script->Id(), foo->GetScriptId()); | 16657 CHECK_EQ(script->GetId(), foo->ScriptId()); |
yurys
2013/06/25 11:57:38
We should keep old tests as well until the API is
| |
16658 CHECK_EQ(script->Id(), bar->GetScriptId()); | 16658 CHECK_EQ(script->GetId(), bar->ScriptId()); |
16659 } | 16659 } |
16660 | 16660 |
16661 | 16661 |
16662 static void GetterWhichReturns42( | 16662 static void GetterWhichReturns42( |
16663 Local<String> name, | 16663 Local<String> name, |
16664 const v8::PropertyCallbackInfo<v8::Value>& info) { | 16664 const v8::PropertyCallbackInfo<v8::Value>& info) { |
16665 CHECK(v8::Utils::OpenHandle(*info.This())->IsJSObject()); | 16665 CHECK(v8::Utils::OpenHandle(*info.This())->IsJSObject()); |
16666 CHECK(v8::Utils::OpenHandle(*info.Holder())->IsJSObject()); | 16666 CHECK(v8::Utils::OpenHandle(*info.Holder())->IsJSObject()); |
16667 info.GetReturnValue().Set(v8_num(42)); | 16667 info.GetReturnValue().Set(v8_num(42)); |
16668 } | 16668 } |
(...skipping 2712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
19381 i::Semaphore* sem_; | 19381 i::Semaphore* sem_; |
19382 volatile int sem_value_; | 19382 volatile int sem_value_; |
19383 }; | 19383 }; |
19384 | 19384 |
19385 | 19385 |
19386 THREADED_TEST(SemaphoreInterruption) { | 19386 THREADED_TEST(SemaphoreInterruption) { |
19387 ThreadInterruptTest().RunTest(); | 19387 ThreadInterruptTest().RunTest(); |
19388 } | 19388 } |
19389 | 19389 |
19390 #endif // WIN32 | 19390 #endif // WIN32 |
OLD | NEW |