Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 378 } | 378 } |
| 379 SetProperty(stackFrame, line_key, | 379 SetProperty(stackFrame, line_key, |
| 380 Handle<Smi>(Smi::FromInt(line_number + 1)), NONE); | 380 Handle<Smi>(Smi::FromInt(line_number + 1)), NONE); |
| 381 } | 381 } |
| 382 | 382 |
| 383 if (options & StackTrace::kScriptName) { | 383 if (options & StackTrace::kScriptName) { |
| 384 Handle<Object> script_name(script->name()); | 384 Handle<Object> script_name(script->name()); |
| 385 SetProperty(stackFrame, script_key, script_name, NONE); | 385 SetProperty(stackFrame, script_key, script_name, NONE); |
| 386 } | 386 } |
| 387 | 387 |
| 388 if (options & StackTrace::kScriptNameOrSourceURL) { | |
| 389 Handle<Object> script_name(script->name()); | |
| 390 Handle<String> method_name = | |
|
Vitaly Repeshko
2010/10/05 10:21:43
To be consistent with existing column_key, line_ke
| |
| 391 Factory::LookupAsciiSymbol("nameOrSourceURL"); | |
| 392 Handle<JSValue> script_wrapper = GetScriptWrapper(Handle<Script>(script)); | |
|
Vitaly Repeshko
2010/10/05 10:21:43
Hmm, the script handle should have been created mu
| |
| 393 Handle<Object> property = GetProperty(script_wrapper, method_name); | |
| 394 ASSERT(property->IsJSFunction()); | |
| 395 Handle<JSFunction> method = Handle<JSFunction>::cast(property); | |
| 396 bool caught_exception; | |
| 397 Handle<Object> result = Execution::TryCall(method, script_wrapper, 0, | |
| 398 NULL, &caught_exception); | |
| 399 if (caught_exception) { | |
| 400 result = Factory::undefined_value(); | |
| 401 } | |
| 402 Handle<String> script_name_or_source_url_key = | |
| 403 Factory::LookupAsciiSymbol("scriptNameOrSourceURL"); | |
| 404 SetProperty(stackFrame, script_name_or_source_url_key, result, NONE); | |
| 405 } | |
| 406 | |
| 388 if (options & StackTrace::kFunctionName) { | 407 if (options & StackTrace::kFunctionName) { |
| 389 Handle<Object> fun_name(fun->shared()->name()); | 408 Handle<Object> fun_name(fun->shared()->name()); |
| 390 if (fun_name->ToBoolean()->IsFalse()) { | 409 if (fun_name->ToBoolean()->IsFalse()) { |
| 391 fun_name = Handle<Object>(fun->shared()->inferred_name()); | 410 fun_name = Handle<Object>(fun->shared()->inferred_name()); |
| 392 } | 411 } |
| 393 SetProperty(stackFrame, function_key, fun_name, NONE); | 412 SetProperty(stackFrame, function_key, fun_name, NONE); |
| 394 } | 413 } |
| 395 | 414 |
| 396 if (options & StackTrace::kIsEval) { | 415 if (options & StackTrace::kIsEval) { |
| 397 int type = Smi::cast(script->compilation_type())->value(); | 416 int type = Smi::cast(script->compilation_type())->value(); |
| (...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1020 Top::break_access_->Lock(); | 1039 Top::break_access_->Lock(); |
| 1021 } | 1040 } |
| 1022 | 1041 |
| 1023 | 1042 |
| 1024 ExecutionAccess::~ExecutionAccess() { | 1043 ExecutionAccess::~ExecutionAccess() { |
| 1025 Top::break_access_->Unlock(); | 1044 Top::break_access_->Unlock(); |
| 1026 } | 1045 } |
| 1027 | 1046 |
| 1028 | 1047 |
| 1029 } } // namespace v8::internal | 1048 } } // namespace v8::internal |
| OLD | NEW |