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

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

Issue 2672053003: Pass is_module flag when we V8ScriptRunner::compileModule (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 return (*compileFn)(isolate, code, origin); 493 return (*compileFn)(isolate, code, origin);
494 } 494 }
495 495
496 v8::MaybeLocal<v8::Module> V8ScriptRunner::compileModule( 496 v8::MaybeLocal<v8::Module> V8ScriptRunner::compileModule(
497 v8::Isolate* isolate, 497 v8::Isolate* isolate,
498 const String& source, 498 const String& source,
499 const String& fileName) { 499 const String& fileName) {
500 TRACE_EVENT1("v8", "v8.compileModule", "fileName", fileName.utf8()); 500 TRACE_EVENT1("v8", "v8.compileModule", "fileName", fileName.utf8());
501 // TODO(adamk): Add Inspector integration? 501 // TODO(adamk): Add Inspector integration?
502 // TODO(adamk): Pass more info into ScriptOrigin. 502 // TODO(adamk): Pass more info into ScriptOrigin.
503 v8::ScriptOrigin origin(v8String(isolate, fileName)); 503 v8::ScriptOrigin origin(v8String(isolate, fileName),
504 v8::Integer::New(isolate, 0), // line_offset
505 v8::Integer::New(isolate, 0), // col_offset
506 v8Boolean(true, isolate), // accessControlStatus
507 v8::Local<v8::Integer>(), // script id
508 v8String(isolate, ""), // source_map_url
509 v8Boolean(false, isolate), // accessControlStatus
510 v8Boolean(false, isolate), // is_wasm
511 v8Boolean(true, isolate)); // is_module
504 v8::ScriptCompiler::Source scriptSource(v8String(isolate, source), origin); 512 v8::ScriptCompiler::Source scriptSource(v8String(isolate, source), origin);
505 return v8::ScriptCompiler::CompileModule(isolate, &scriptSource); 513 return v8::ScriptCompiler::CompileModule(isolate, &scriptSource);
506 } 514 }
507 515
508 v8::MaybeLocal<v8::Value> V8ScriptRunner::runCompiledScript( 516 v8::MaybeLocal<v8::Value> V8ScriptRunner::runCompiledScript(
509 v8::Isolate* isolate, 517 v8::Isolate* isolate,
510 v8::Local<v8::Script> script, 518 v8::Local<v8::Script> script,
511 ExecutionContext* context) { 519 ExecutionContext* context) {
512 ASSERT(!script.IsEmpty()); 520 ASSERT(!script.IsEmpty());
513 ScopedFrameBlamer frameBlamer( 521 ScopedFrameBlamer frameBlamer(
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 v8AtomicString(isolate, "((e) => { throw e; })"), origin) 775 v8AtomicString(isolate, "((e) => { throw e; })"), origin)
768 .ToLocalChecked(); 776 .ToLocalChecked();
769 v8::Local<v8::Function> thrower = runCompiledInternalScript(isolate, script) 777 v8::Local<v8::Function> thrower = runCompiledInternalScript(isolate, script)
770 .ToLocalChecked() 778 .ToLocalChecked()
771 .As<v8::Function>(); 779 .As<v8::Function>();
772 v8::Local<v8::Value> args[] = {exception}; 780 v8::Local<v8::Value> args[] = {exception};
773 callInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate); 781 callInternalFunction(thrower, thrower, WTF_ARRAY_LENGTH(args), args, isolate);
774 } 782 }
775 783
776 } // namespace blink 784 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698