Skip to content

Regex hangs the browser #23

Description

@tdhooper

const results = regex.exec(rawFragmentShader);

I'm trying to run some non-ISF shaders through the parser which cause this line to hang the browser. Instead of doing this validity check and grabbing the metadata block with an expensive regex, why not use the startIndex and endIndex endpoints you define later?

If you're wondering why I'm trying to parse non-ISF shaders, consider a live-update application where someone makes a typo, or in my case where I'm supporting multiple shader metadata formats, and only want to invoke ISF if it's a valid ISF shader.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions