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.

Remove usages of ??= operators throught the library

See original GitHub issue

Bug Description

There library is targeting Node 14 & 16, but contains usages of the ??= operator which is blocking production builds for various apps which are locked into Node 14. One was recently replaced, but there’s at least one more…

Reproducible By

Consuming library in Node.js v14 environment

Expected Behavior

Should run in Node.js v14 as expected

Logs & Screenshots

this[kHeadersList][kHeadersSortedMap] ??= new Map([...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1))

Environment

Ubuntu 18.04 LTS, Node lts/fermium

Additional context

Previous PR replacing another of these operators:

https://github.com/nodejs/undici/pull/1318

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
n1ru4lcommented, May 2, 2022

@matthewlilley Probably the Next.js compiler.

You can close this issue here and the discussion can continue on the one your created for graph-client. I am certain we all will find a solution.

1reaction
n1ru4lcommented, May 10, 2022

@ronag Some people bundle their Node.js application code into a single JavaScript file that contains everything for easier/faster deployment. I guess in this case people would have to transpile the undici with babel or even better omit the non-“Node.js 14” code by configuring webpack to instead load a “noop” module.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Replacing operator new and operator delete in applications ...
Replacing operator new and operator delete in applications that use shared libraries (C++). Edit online. You can define your own versions of operator...
Read more >
New and delete operators override in libraries - Stack Overflow
have their own globally overridden version of the new and the delete operators and they use their own memory management?
Read more >
operator delete, operator delete[] - cppreference.com
1) Called by delete-expressions to deallocate storage previously allocated for a single object. The behavior of the standard library ...
Read more >
new and delete operators | Microsoft Learn
C++ supports dynamic allocation and deallocation of objects using the new and delete operators. These operators allocate memory for objects ...
Read more >
Overloading New and Delete operator in c++ - GeeksforGeeks
We can use realloc() function in new function to re-allocate memory dynamically. 7. Overloaded new operator also enables programmers to squeeze ...
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