Chromium Code Reviews| 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 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 722 V8CompileHistogram::Cacheability::kNoncacheable, isolate, | 722 V8CompileHistogram::Cacheability::kNoncacheable, isolate, |
| 723 V8AtomicString(isolate, "((e) => { throw e; })"), origin) | 723 V8AtomicString(isolate, "((e) => { throw e; })"), origin) |
| 724 .ToLocalChecked(); | 724 .ToLocalChecked(); |
| 725 v8::Local<v8::Function> thrower = RunCompiledInternalScript(isolate, script) | 725 v8::Local<v8::Function> thrower = RunCompiledInternalScript(isolate, script) |
| 726 .ToLocalChecked() | 726 .ToLocalChecked() |
| 727 .As<v8::Function>(); | 727 .As<v8::Function>(); |
| 728 v8::Local<v8::Value> args[] = {exception}; | 728 v8::Local<v8::Value> args[] = {exception}; |
| 729 CallInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate); | 729 CallInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate); |
| 730 } | 730 } |
| 731 | 731 |
| 732 v8::MaybeLocal<v8::Value> V8ScriptRunner::CallExtraHelper( | |
| 733 ScriptState* script_state, | |
| 734 const char* name, | |
| 735 size_t num_args, | |
| 736 v8::Local<v8::Value>* args) { | |
| 737 v8::Isolate* isolate = script_state->GetIsolate(); | |
| 738 v8::Local<v8::Value> undefined = v8::Undefined(isolate); | |
|
haraken
2017/04/13 22:55:44
Nit: This variable looks redundant.
adithyas
2017/04/18 15:28:12
Yup, removed.
| |
| 739 v8::Local<v8::Value> function_value; | |
| 740 v8::Local<v8::Context> context = script_state->GetContext(); | |
| 741 if (!context->GetExtrasBindingObject() | |
| 742 ->Get(context, V8AtomicString(isolate, name)) | |
| 743 .ToLocal(&function_value)) | |
| 744 return v8::MaybeLocal<v8::Value>(); | |
| 745 v8::Local<v8::Function> function = function_value.As<v8::Function>(); | |
| 746 return V8ScriptRunner::CallInternalFunction(function, undefined, num_args, | |
| 747 args, isolate); | |
| 748 } | |
| 749 | |
| 732 } // namespace blink | 750 } // namespace blink |
| OLD | NEW |