Opened 15 months ago

Closed 15 months ago

Last modified 9 months ago

#6972 closed change (fixed)

Use Buffer.from instead of Buffer constructor

Reported by: mjethani Assignee: mjethani
Priority: P3 Milestone:
Module: Core Keywords:
Cc: Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/29887560/

Description

Background

In test/_common.js, we're using the Buffer constructor, which is deprecated and gives a warning on Node.js v10.10.0:

signatures.js
(node:87303) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

The replacement is the Buffer.from function, which has been available since Node.js v5.10.0.

What to change

Replace new Buffer with Buffer.from in test/_common.js.

Hints for testers

There's nothing to test.

Change History (5)

comment:1 Changed 15 months ago by mjethani

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:2 Changed 15 months ago by abpbot

A commit referencing this issue has landed:
Issue 6972 - Use Buffer.from in tests

comment:3 Changed 15 months ago by mjethani

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:4 Changed 14 months ago by abpbot

A commit referencing this issue has landed:
Issue 6972 - Use Buffer.from in tests

comment:5 Changed 9 months ago by ukacar

  • Verified working set
Note: See TracTickets for help on using tickets.