File: drop-__proto__.patch

package info (click to toggle)
node-clone 2.1.2-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 160 kB
  • sloc: javascript: 1,261; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 317 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Description: drop __proto__ call
Author: Yadd <yadd@debian.org>
Forwarded: no
Last-Update: 2022-09-14

--- a/test.js
+++ b/test.js
@@ -240,7 +240,7 @@
   var n = null;
 
   var a = { foo: 'bar' };
-  a.__proto__ = n;
+  Object.setPrototypeOf(a, n);
   test.ok(typeof a === 'object');
   test.ok(typeof a !== null);