Skip to content

Safari 18.4 supports context parameter in JSON.parse() reviver#26745

Merged
caugner merged 1 commit into
mdn:mainfrom
kksys:reviver_context_parameter_safari
May 9, 2025
Merged

Safari 18.4 supports context parameter in JSON.parse() reviver#26745
caugner merged 1 commit into
mdn:mainfrom
kksys:reviver_context_parameter_safari

Conversation

@kksys

@kksys kksys commented May 8, 2025

Copy link
Copy Markdown
Contributor

Summary

Update Safari data for context parameter on reviver function of JSON.parse feature

Test results and supporting details

  • How
    Running on below script on Console tab on Developer Tool of Safari 18.4 directly.

    var json = '{"test":"abc","test2":"def","test3":{"test4":"ghi"}}'
    JSON.parse(json, (key, value, context) => {
      console.log({ key, value, context })
      return value
    })
    
  • Result

    Result on Safari 18.4

Related issues

@github-actions github-actions Bot added the data:js Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript label May 8, 2025
@kksys kksys marked this pull request as ready for review May 8, 2025 05:25
@github-actions github-actions Bot added the size:xs [PR only] 0-6 LoC changed label May 8, 2025
@github-actions

github-actions Bot commented May 8, 2025

Copy link
Copy Markdown
Contributor

Tip: Review these changes grouped by change (recommended for most PRs), or grouped by feature (for large PRs).

@caugner caugner changed the title Update Reviver has context parameter for Safari Safari 18.4 supports context parameter in JSON.parse() reviver May 9, 2025
@caugner caugner merged commit ce99201 into mdn:main May 9, 2025
5 checks passed
@caugner

caugner commented May 9, 2025

Copy link
Copy Markdown
Contributor

Thanks! 🎉

@kksys kksys deleted the reviver_context_parameter_safari branch May 15, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

data:js Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript size:xs [PR only] 0-6 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

javascript.builtins.JSON.parse - Safari 18.4 added 3rd parameter on reviver function

2 participants