Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Make some builtin functions aware of abstract strings. #1110

Closed
wants to merge 1 commit into from

Conversation

hermanventer
Copy link
Contributor

Builtin functions that are side-effect free can trivially be modified to return abstract values if one or more of their arguments are abstract.

This pull request provides such behavior for the Error constructor, Error.prototype.toString and String.prototype.split and slice.

Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hermanventer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

export function ToStringValue(realm: Realm, val: Value): Value {
if (val.getType() === StringValue) return val;
let str;
if (typeof val === "string") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code

leobalter pushed a commit to bocoup/prepack that referenced this pull request Oct 31, 2017
Summary:
Builtin functions that are side-effect free can trivially be modified to return abstract values if one or more of their arguments are abstract.

This pull request provides such behavior for the Error constructor, Error.prototype.toString and String.prototype.split and slice.
Closes facebookarchive#1110

Differential Revision: D6182526

Pulled By: hermanventer

fbshipit-source-id: d95c8045ff75c35f1b55dc668c080aa394ccb43d
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants