File: 0001-Use-polyfill-for-isnan.patch

package info (click to toggle)
node-buffer 5.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 600 kB
  • sloc: sh: 31; makefile: 10
file content (33 lines) | stat: -rw-r--r-- 836 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 5f5ef39d5923cce8021974a7bcb881223b021843 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastien=20ROUCARI=C3=88S?= <roucaries.bastien@gmail.com>
Date: Sun, 9 Apr 2017 18:41:33 +0200
Subject: Use polyfill for isnan

Do not need for test suite to use package.

Forwarded: no
---
 test/write.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/test/write.js b/test/write.js
index f6fc9f3..b7fe589 100644
--- a/test/write.js
+++ b/test/write.js
@@ -1,6 +1,15 @@
 var B = require('../').Buffer
 var test = require('tape')
-var isnan = require('is-nan')
+
+if (!Number.isNaN){
+    Number.isNaN = function isNaN(x){
+	return x !== x;
+    };
+}
+
+var isnan = function isNaN(value) {
+    return value !== value;
+};
 
 test('buffer.write string should get parsed as number', function (t) {
   var b = new B(64)