Invalid RegularExpression causes failure on loading of script bundled with Spector.js on IOS <= 15

Open Beginner friendly
#419 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Domain
frontend

Research direction

The failing pattern is the .replace(/(?<!e.*)0+$/, "") call quoted in the issue; search the TypeScript sources for that trailing-zero stripping, since the payload names no file. Read the surrounding code to see what the e lookbehind is meant to protect, then find an equivalent expression that avoids lookbehind. Done when the pattern has no (?<! and existing number formatting output is unchanged, and the bundle loads on iOS 15 Safari.

Written by the indexing model from the issue text.

Description

The latest version of SpectorJS contains the following line
.replace(/(?<!e.*)0+$/, ""))

Lookbehinds (<!) are not supported in IOS 15 and lower.
This causes any scripts bundled with Spector.js to not load and throw an error

image
Dominant language
TypeScript
Stars
1.6k
Forks
193
Avg merge
12m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from BabylonJS/Spector.js

All issues in BabylonJS/Spector.js

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.