Skip to content

Commit

Permalink
Add stack checker in Proxy call and construct methods
Browse files Browse the repository at this point in the history
Signed-off-by: HyukWoo Park <[email protected]>
  • Loading branch information
clover2123 authored and ksh8281 committed Sep 12, 2024
1 parent 55d3c17 commit 0eac4dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/runtime/ProxyObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,8 @@ bool ProxyObject::set(ExecutionState& state, const ObjectPropertyName& propertyN
// https://www.ecma-international.org/ecma-262/6.0/#sec-proxy-object-internal-methods-and-internal-slots-call-thisargument-argumentslist
Value ProxyObject::call(ExecutionState& state, const Value& receiver, const size_t argc, Value* argv)
{
CHECK_STACK_OVERFLOW(state);

if (UNLIKELY(!m_isCallable)) {
ErrorObject::throwBuiltinError(state, ErrorCode::TypeError, ErrorObject::Messages::NOT_Callable);
}
Expand Down Expand Up @@ -991,6 +993,8 @@ Value ProxyObject::call(ExecutionState& state, const Value& receiver, const size
// https://www.ecma-international.org/ecma-262/6.0/#sec-proxy-object-internal-methods-and-internal-slots-construct-argumentslist-newtarget
Value ProxyObject::construct(ExecutionState& state, const size_t argc, Value* argv, Object* newTarget)
{
CHECK_STACK_OVERFLOW(state);

auto strings = &state.context()->staticStrings();
// 2. If handler is null, throw a TypeError exception.
if (this->handler() == nullptr) {
Expand Down

0 comments on commit 0eac4dc

Please sign in to comment.