| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 V8CompileHistogram::Cacheability::kNoncacheable, isolate, | 724 V8CompileHistogram::Cacheability::kNoncacheable, isolate, |
| 725 V8AtomicString(isolate, "((e) => { throw e; })"), origin) | 725 V8AtomicString(isolate, "((e) => { throw e; })"), origin) |
| 726 .ToLocalChecked(); | 726 .ToLocalChecked(); |
| 727 v8::Local<v8::Function> thrower = RunCompiledInternalScript(isolate, script) | 727 v8::Local<v8::Function> thrower = RunCompiledInternalScript(isolate, script) |
| 728 .ToLocalChecked() | 728 .ToLocalChecked() |
| 729 .As<v8::Function>(); | 729 .As<v8::Function>(); |
| 730 v8::Local<v8::Value> args[] = {exception}; | 730 v8::Local<v8::Value> args[] = {exception}; |
| 731 CallInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate); | 731 CallInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate); |
| 732 } | 732 } |
| 733 | 733 |
| 734 v8::MaybeLocal<v8::Value> V8ScriptRunner::CallExtraHelper( |
| 735 ScriptState* script_state, |
| 736 const char* name, |
| 737 size_t num_args, |
| 738 v8::Local<v8::Value>* args) { |
| 739 v8::Isolate* isolate = script_state->GetIsolate(); |
| 740 v8::Local<v8::Value> function_value; |
| 741 v8::Local<v8::Context> context = script_state->GetContext(); |
| 742 if (!context->GetExtrasBindingObject() |
| 743 ->Get(context, V8AtomicString(isolate, name)) |
| 744 .ToLocal(&function_value)) |
| 745 return v8::MaybeLocal<v8::Value>(); |
| 746 v8::Local<v8::Function> function = function_value.As<v8::Function>(); |
| 747 return V8ScriptRunner::CallInternalFunction(function, v8::Undefined(isolate), |
| 748 num_args, args, isolate); |
| 749 } |
| 750 |
| 734 } // namespace blink | 751 } // namespace blink |
| OLD | NEW |