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 4252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4263 | 4263 |
4264 static void IndexedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) { | 4264 static void IndexedEnum(const v8::PropertyCallbackInfo<v8::Array>& info) { |
4265 v8::Isolate* isolate = info.GetIsolate(); | 4265 v8::Isolate* isolate = info.GetIsolate(); |
4266 v8::Handle<v8::Array> result = v8::Array::New(isolate, 2); | 4266 v8::Handle<v8::Array> result = v8::Array::New(isolate, 2); |
4267 result->Set(v8::Integer::New(isolate, 0), v8::Number::New(isolate, 1)); | 4267 result->Set(v8::Integer::New(isolate, 0), v8::Number::New(isolate, 1)); |
4268 result->Set(v8::Integer::New(isolate, 1), v8::Number::New(isolate, 10)); | 4268 result->Set(v8::Integer::New(isolate, 1), v8::Number::New(isolate, 10)); |
4269 info.GetReturnValue().Set(result); | 4269 info.GetReturnValue().Set(result); |
4270 } | 4270 } |
4271 | 4271 |
4272 | 4272 |
4273 static void NamedGetter(v8::Local<v8::String> name, | 4273 static void NamedGetter(v8::Local<v8::Name> name, |
4274 const v8::PropertyCallbackInfo<v8::Value>& info) { | 4274 const v8::PropertyCallbackInfo<v8::Value>& info) { |
4275 v8::String::Utf8Value n(name); | 4275 if (name->IsSymbol()) return; |
| 4276 v8::String::Utf8Value n(v8::Local<v8::String>::Cast(name)); |
4276 if (strcmp(*n, "a") == 0) { | 4277 if (strcmp(*n, "a") == 0) { |
4277 info.GetReturnValue().Set(v8::String::NewFromUtf8(info.GetIsolate(), "AA")); | 4278 info.GetReturnValue().Set(v8::String::NewFromUtf8(info.GetIsolate(), "AA")); |
4278 return; | 4279 return; |
4279 } else if (strcmp(*n, "b") == 0) { | 4280 } else if (strcmp(*n, "b") == 0) { |
4280 info.GetReturnValue().Set(v8::String::NewFromUtf8(info.GetIsolate(), "BB")); | 4281 info.GetReturnValue().Set(v8::String::NewFromUtf8(info.GetIsolate(), "BB")); |
4281 return; | 4282 return; |
4282 } else if (strcmp(*n, "c") == 0) { | 4283 } else if (strcmp(*n, "c") == 0) { |
4283 info.GetReturnValue().Set(v8::String::NewFromUtf8(info.GetIsolate(), "CC")); | 4284 info.GetReturnValue().Set(v8::String::NewFromUtf8(info.GetIsolate(), "CC")); |
4284 return; | 4285 return; |
4285 } else { | 4286 } else { |
(...skipping 3118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7404 v8::Isolate* isolate = env->GetIsolate(); | 7405 v8::Isolate* isolate = env->GetIsolate(); |
7405 v8::HandleScope scope(isolate); | 7406 v8::HandleScope scope(isolate); |
7406 v8::Debug::SetDebugEventListener(DebugBreakTriggerTerminate); | 7407 v8::Debug::SetDebugEventListener(DebugBreakTriggerTerminate); |
7407 TerminationThread terminator(isolate); | 7408 TerminationThread terminator(isolate); |
7408 terminator.Start(); | 7409 terminator.Start(); |
7409 v8::TryCatch try_catch; | 7410 v8::TryCatch try_catch; |
7410 v8::Debug::DebugBreak(isolate); | 7411 v8::Debug::DebugBreak(isolate); |
7411 CompileRun("while (true);"); | 7412 CompileRun("while (true);"); |
7412 CHECK(try_catch.HasTerminated()); | 7413 CHECK(try_catch.HasTerminated()); |
7413 } | 7414 } |
OLD | NEW |