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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 { | 80 { |
81 return callExtraHelper(scriptState, name, N, args); | 81 return callExtraHelper(scriptState, name, N, args); |
82 } | 82 } |
83 | 83 |
84 template <size_t N> | 84 template <size_t N> |
85 static v8::Local<v8::Value> callExtraOrCrash(ScriptState* scriptState, const
char* name, v8::Local<v8::Value>(&args)[N]) | 85 static v8::Local<v8::Value> callExtraOrCrash(ScriptState* scriptState, const
char* name, v8::Local<v8::Value>(&args)[N]) |
86 { | 86 { |
87 return callExtraHelper(scriptState, name, N, args).ToLocalChecked(); | 87 return callExtraHelper(scriptState, name, N, args).ToLocalChecked(); |
88 } | 88 } |
89 | 89 |
| 90 static void throwException(v8::Isolate*, v8::Local<v8::Value> exception, con
st v8::ScriptOrigin&); |
| 91 |
90 private: | 92 private: |
91 static v8::MaybeLocal<v8::Value> callExtraHelper(ScriptState* scriptState, c
onst char* name, size_t numArgs, v8::Local<v8::Value>* args) | 93 static v8::MaybeLocal<v8::Value> callExtraHelper(ScriptState* scriptState, c
onst char* name, size_t numArgs, v8::Local<v8::Value>* args) |
92 { | 94 { |
93 v8::Isolate* isolate = scriptState->isolate(); | 95 v8::Isolate* isolate = scriptState->isolate(); |
94 v8::Local<v8::Value> undefined = v8::Undefined(isolate); | 96 v8::Local<v8::Value> undefined = v8::Undefined(isolate); |
95 v8::Local<v8::Value> functionValue = scriptState->getFromExtrasExports(n
ame).v8Value(); | 97 v8::Local<v8::Value> functionValue = scriptState->getFromExtrasExports(n
ame).v8Value(); |
96 if (functionValue.IsEmpty()) | 98 if (functionValue.IsEmpty()) |
97 return v8::MaybeLocal<v8::Value>(); | 99 return v8::MaybeLocal<v8::Value>(); |
98 v8::Local<v8::Function> function = functionValue.As<v8::Function>(); | 100 v8::Local<v8::Function> function = functionValue.As<v8::Function>(); |
99 return V8ScriptRunner::callInternalFunction(function, undefined, numArgs
, args, isolate); | 101 return V8ScriptRunner::callInternalFunction(function, undefined, numArgs
, args, isolate); |
100 } | 102 } |
101 }; | 103 }; |
102 | 104 |
103 } // namespace blink | 105 } // namespace blink |
104 | 106 |
105 #endif // V8ScriptRunner_h | 107 #endif // V8ScriptRunner_h |
OLD | NEW |