Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp

Issue 2838933003: [not-for-commit] kitsune changes + pending kouhei changes (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
index e96dcd5fd67c23fc93f498491a663a7cf50fd7fd..5801ea8265a396884f4126145d231df7c6a8c6c4 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8ScriptRunner.cpp
@@ -523,6 +523,28 @@ v8::MaybeLocal<v8::Module> V8ScriptRunner::CompileModule(
return v8::ScriptCompiler::CompileModule(isolate, &script_source);
}
+void V8ScriptRunner::ReportExceptionForModule(v8::Isolate* isolate,
+ v8::Local<v8::Value> exception,
+ const String& file_name) {
+ // |origin| is for compiling a fragment that throws |exception|.
+ // Therefore |is_module| is false and |access_control_status| is
+ // kSharableCrossOrigin.
+ AccessControlStatus access_control_status = kSharableCrossOrigin;
+ v8::ScriptOrigin origin(
+ V8String(isolate, file_name),
+ v8::Integer::New(isolate, 0), // line_offset
+ v8::Integer::New(isolate, 0), // col_offset
+ v8::Boolean::New(isolate, access_control_status == kSharableCrossOrigin),
+ v8::Local<v8::Integer>(), // script id
+ v8::String::Empty(isolate), // source_map_url
+ v8::Boolean::New(isolate, access_control_status == kOpaqueResource),
+ v8::False(isolate), // is_wasm
+ v8::False(isolate)); // is_module
+
+ ThrowException(isolate, exception, origin);
+ // v8::Exception::TypeError(V8String(isolate, "FOXME Message"))
+}
+
v8::MaybeLocal<v8::Value> V8ScriptRunner::RunCompiledScript(
v8::Isolate* isolate,
v8::Local<v8::Script> script,

Powered by Google App Engine
This is Rietveld 408576698