• Stefano Sanfilippo's avatar
    [compiler, api] Allow modifying codegen hook to block non-strings. · 6c0825aa
    Stefano Sanfilippo authored
    Instead of inferring allow_codegen from the state of MaybeLocal<String>, return it separately. This allows to distinguish "could not stringify this object" from "block execution of this object", regardless of whether the object is a string or not. Currently, the hook can trigger an EvalError only if the original source was a string.
    
    Modify the logic so that one of the three mechanisms (unconditional, non-modifying, modifying) decides alone. Before, if the non-modifying callback rejected a value, the value would be forwarded to the modifying callback, but the unconditional would not forward to the non-modifying callback. This introduces a more uniform behaviour where the three mechanisms act in decreasing priority.
    
    Change-Id: Iaaa9873227052653d714df65f31c4de914f48b7d
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1776082Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
    Reviewed-by: 's avatarDaniel Vogelheim <vogelheim@chromium.org>
    Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
    Commit-Queue: Stefano Sanfilippo <ssanfilippo@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#64763}
    6c0825aa
v8.h 379 KB