Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix browser support #172

Merged
merged 3 commits into from
Oct 29, 2024
Merged

Conversation

jerome-benoit
Copy link
Collaborator

closes #171

closes tinylibs#171

Signed-off-by: Jérôme Benoit <[email protected]>
@jerome-benoit jerome-benoit added the bug Something isn't working label Oct 29, 2024
@jerome-benoit jerome-benoit self-assigned this Oct 29, 2024
Copy link

pkg-pr-new bot commented Oct 29, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/tinylibs/tinybench@172

commit: eb777c9

@dasa
Copy link

dasa commented Oct 29, 2024

Alternative could be to feature detect using something like this:

  if ((globalThis as any).process?.hrtime?.bigint) {
    //
  }

Thanks for the quick fix!

@jerome-benoit
Copy link
Collaborator Author

Alternative could be to feature detect using something like this:

I plan to add the JS runtime as a Bench property later on. And also add it to the results object.

@jerome-benoit jerome-benoit merged commit f94c42c into tinylibs:main Oct 29, 2024
6 checks passed
@dasa
Copy link

dasa commented Oct 29, 2024

With v3.0.1 the error is:

Uncaught TypeError: Cannot read properties of undefined (reading 'versions')

@jerome-benoit
Copy link
Collaborator Author

With v3.0.1 the error is:

Uncaught TypeError: Cannot read properties of undefined (reading 'versions')

Fixed in 3.0.3. The linter removed overzealously null condition checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReferenceError in browsers with v3.0.0
2 participants