question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Find an easy way to use `.at` and `Object.hasOwn`

See original GitHub issue

They are available on Node.js 16, but esbuild won’t polyfill for Node.js 14, we do similar thing in main branch by using esbuild -> babel -> esbuild. But this will slow down build process, and the core-js polyfill seems big.

npx esbuild core-js/modules/es.array.at.js --bundle

It’s ~1200 lines, we don’t it so prefect. There should be a better way.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
fiskercommented, Sep 15, 2022

It seems the solution is not too bad #13482 All cost about 20s in both this PR and next branch, maybe because our source files are all small. 😄

1reaction
fiskercommented, Sep 14, 2022

I want to try use babel api in our replaceModule plugin. Not sure how slow can it be.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Object.hasOwn() - JavaScript - MDN Web Docs
The Object.hasOwn() static method returns true if the specified object has the indicated property as its own property.
Read more >
What is Object.hasOwn() and why should we use it over ...
JavaScript. Object.hasOwn() is a new static method which returns true if the specified object has the specified property as its own property.
Read more >
Object.hasOwn() vs Object.prototype.hasOwnProperty()
So, after looking at both Object.hasOwn() and Object.hasOwnProperty() in action, they seems quite the same.. So why should we use Object.
Read more >
What's the deal with Object.prototype.hasOwnProperty.call()?
Prototypal inheritance allows an object to inherit methods and properties on its prototype. It's better to understand with an example: var obj = ......
Read more >
Add `Object.hasOwn` to Section 3.7 (Object.prototype methods)
Hello, it seems that Objct.hasOwn is now available in most major browsers (https://caniuse.com/mdn-javascript_builtins_object_hasown), ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found