Skip to content

Commit

Permalink
Make hasOwnProperty actually check
Browse files Browse the repository at this point in the history
This is for added security
  • Loading branch information
changlinli committed Dec 19, 2023
1 parent e1854f6 commit d906770
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/Generate/JavaScript/Expression.hs
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ generateTailDef mode name argNames body =
(
JS.Infix
JS.OpAnd
(JS.Access (JS.Ref loopReturnName) JsName.hasOwnProperty) (JS.Infix JS.OpEq (JS.Access (JS.Ref loopReturnName) (JsName.fromLocal name)) (JS.Bool True))
(JS.Call (JS.Access (JS.Ref loopReturnName) JsName.hasOwnProperty) [JS.String (JsName.toBuilder $ JsName.fromLocal name)]) (JS.Infix JS.OpEq (JS.Access (JS.Ref loopReturnName) (JsName.fromLocal name)) (JS.Bool True))
)
loopBodyA = JS.Block
[ JS.Var loopReturnName (JS.Call (JS.Ref loopAsFunctionName) [])
Expand Down

0 comments on commit d906770

Please sign in to comment.