Commit 365fd661 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[modules, cleanup] Simplify Print().

R=adamk@chromium.org

Bug: v8:1569
Change-Id: Idf069e7c8dac4a064eacf6bd1db1df3314988e6a
Reviewed-on: https://chromium-review.googlesource.com/553261Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46313}
parent ccb5a1d3
......@@ -1298,14 +1298,7 @@ void ModuleInfoEntry::ModuleInfoEntryPrint(std::ostream& os) { // NOLINT
void Module::ModulePrint(std::ostream& os) { // NOLINT
HeapObject::PrintHeader(os, "Module");
// TODO(neis): Simplify once modules have a script field.
if (status() < kEvaluating) {
SharedFunctionInfo* shared = code()->IsSharedFunctionInfo()
? SharedFunctionInfo::cast(code())
: JSFunction::cast(code())->shared();
Object* origin = Script::cast(shared->script())->GetNameOrSourceURL();
os << "\n - origin: " << Brief(origin);
}
os << "\n - origin: " << Brief(script()->GetNameOrSourceURL());
os << "\n - code: " << Brief(code());
os << "\n - exports: " << Brief(exports());
os << "\n - requested_modules: " << Brief(requested_modules());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment