Changeset 279178 in webkit


Ignore:
Timestamp:
Jun 23, 2021 12:11:59 PM (3 years ago)
Author:
mark.lam@apple.com
Message:

Remove unneeded explicit exception checks in ScriptModuleLoader::evaluate().
https://bugs.webkit.org/show_bug.cgi?id=227302

Reviewed by Yusuke Suzuki.

A RELEASE_AND_RETURN will do because we're just propagating the exception to the
client in both cases.

  • bindings/js/ScriptModuleLoader.cpp:

(WebCore::ScriptModuleLoader::evaluate):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r279172 r279178  
     12021-06-23  Mark Lam  <mark.lam@apple.com>
     2
     3        Remove unneeded explicit exception checks in ScriptModuleLoader::evaluate().
     4        https://bugs.webkit.org/show_bug.cgi?id=227302
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        A RELEASE_AND_RETURN will do because we're just propagating the exception to the
     9        client in both cases.
     10
     11        * bindings/js/ScriptModuleLoader.cpp:
     12        (WebCore::ScriptModuleLoader::evaluate):
     13
    1142021-06-23  Kimmo Kinnunen  <kkinnunen@apple.com>
    215
  • trunk/Source/WebCore/bindings/js/ScriptModuleLoader.cpp

    r279170 r279178  
    11/*
    2  * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
     2 * Copyright (C) 2015-2021 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    245245
    246246    if (m_ownerType == OwnerType::Document) {
    247         if (auto* frame = downcast<Document>(m_context).frame()) {
    248             auto jsValue = frame->script().evaluateModule(sourceURL, *moduleRecord, awaitedValue, resumeMode);
    249             RETURN_IF_EXCEPTION(scope, JSC::jsUndefined());
    250             return jsValue;
    251         }
     247        if (auto* frame = downcast<Document>(m_context).frame())
     248            RELEASE_AND_RETURN(scope, frame->script().evaluateModule(sourceURL, *moduleRecord, awaitedValue, resumeMode));
    252249    } else {
    253250        ASSERT(is<WorkerOrWorkletGlobalScope>(m_context));
    254         if (auto* script = downcast<WorkerOrWorkletGlobalScope>(m_context).script()) {
    255             auto jsValue = script->evaluateModule(*moduleRecord, awaitedValue, resumeMode);
    256             RETURN_IF_EXCEPTION(scope, JSC::jsUndefined());
    257             return jsValue;
    258         }
     251        if (auto* script = downcast<WorkerOrWorkletGlobalScope>(m_context).script())
     252            RELEASE_AND_RETURN(scope, script->evaluateModule(*moduleRecord, awaitedValue, resumeMode));
    259253    }
    260254    return JSC::jsUndefined();
Note: See TracChangeset for help on using the changeset viewer.