OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 int call_count = 0; | 202 int call_count = 0; |
203 | 203 |
204 | 204 |
205 void TerminateOrReturnObject(const v8::FunctionCallbackInfo<v8::Value>& args) { | 205 void TerminateOrReturnObject(const v8::FunctionCallbackInfo<v8::Value>& args) { |
206 if (++call_count == 10) { | 206 if (++call_count == 10) { |
207 CHECK(!v8::V8::IsExecutionTerminating(args.GetIsolate())); | 207 CHECK(!v8::V8::IsExecutionTerminating(args.GetIsolate())); |
208 v8::V8::TerminateExecution(args.GetIsolate()); | 208 v8::V8::TerminateExecution(args.GetIsolate()); |
209 return; | 209 return; |
210 } | 210 } |
211 v8::Local<v8::Object> result = v8::Object::New(); | 211 v8::Local<v8::Object> result = v8::Object::New(args.GetIsolate()); |
212 result->Set(v8::String::NewFromUtf8(args.GetIsolate(), "x"), | 212 result->Set(v8::String::NewFromUtf8(args.GetIsolate(), "x"), |
213 v8::Integer::New(42)); | 213 v8::Integer::New(args.GetIsolate(), 42)); |
214 args.GetReturnValue().Set(result); | 214 args.GetReturnValue().Set(result); |
215 } | 215 } |
216 | 216 |
217 | 217 |
218 void LoopGetProperty(const v8::FunctionCallbackInfo<v8::Value>& args) { | 218 void LoopGetProperty(const v8::FunctionCallbackInfo<v8::Value>& args) { |
219 v8::TryCatch try_catch; | 219 v8::TryCatch try_catch; |
220 CHECK(!v8::V8::IsExecutionTerminating(args.GetIsolate())); | 220 CHECK(!v8::V8::IsExecutionTerminating(args.GetIsolate())); |
221 v8::Script::Compile( | 221 v8::Script::Compile( |
222 v8::String::NewFromUtf8(args.GetIsolate(), | 222 v8::String::NewFromUtf8(args.GetIsolate(), |
223 "function f() {" | 223 "function f() {" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 v8::Handle<v8::ObjectTemplate> global = CreateGlobalTemplate( | 351 v8::Handle<v8::ObjectTemplate> global = CreateGlobalTemplate( |
352 isolate, TerminateCurrentThread, DoLoopCancelTerminate); | 352 isolate, TerminateCurrentThread, DoLoopCancelTerminate); |
353 v8::Handle<v8::Context> context = v8::Context::New(isolate, NULL, global); | 353 v8::Handle<v8::Context> context = v8::Context::New(isolate, NULL, global); |
354 v8::Context::Scope context_scope(context); | 354 v8::Context::Scope context_scope(context); |
355 CHECK(!v8::V8::IsExecutionTerminating(CcTest::isolate())); | 355 CHECK(!v8::V8::IsExecutionTerminating(CcTest::isolate())); |
356 v8::Handle<v8::String> source = v8::String::NewFromUtf8( | 356 v8::Handle<v8::String> source = v8::String::NewFromUtf8( |
357 isolate, "try { doloop(); } catch(e) { fail(); } 'completed';"); | 357 isolate, "try { doloop(); } catch(e) { fail(); } 'completed';"); |
358 // Check that execution completed with correct return value. | 358 // Check that execution completed with correct return value. |
359 CHECK(v8::Script::Compile(source)->Run()->Equals(v8_str("completed"))); | 359 CHECK(v8::Script::Compile(source)->Run()->Equals(v8_str("completed"))); |
360 } | 360 } |
OLD | NEW |