]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs-revert-utf8-v8.patch
add system_v8 bcond
[packages/nodejs.git] / nodejs-revert-utf8-v8.patch
CommitLineData
be62a70f
ER
1From c7c934c66cd8712c9ff169f1ef4c5670d3ff99c8 Mon Sep 17 00:00:00 2001
2From: "T.C. Hollingsworth" <tchollingsworth@gmail.com>
3Date: Wed, 18 Jun 2014 23:09:03 -0700
4Subject: [PATCH] Revert "string_bytes: Guarantee valid utf-8 output"
5
6This reverts commit 0da4c671659cfbae12def127b2e94690b9d9b5e1.
7---
8 src/node.cc | 7 -------
9 src/string_bytes.cc | 2 +-
10 src/string_bytes.h | 2 --
11 test/simple/test-buffer.js | 12 ------------
12 4 files changed, 1 insertion(+), 22 deletions(-)
13
14diff --git a/src/node.cc b/src/node.cc
15index 4223973..e9696cd 100644
16--- a/src/node.cc
17+++ b/src/node.cc
295463b0 18@@ -180,9 +180,6 @@ static uv_async_t dispatch_debug_messages_async;
be62a70f
ER
19 // Declared in node_internals.h
20 Isolate* node_isolate = NULL;
21
22-int WRITE_UTF8_FLAGS = v8::String::HINT_MANY_WRITES_EXPECTED |
23- v8::String::NO_NULL_TERMINATION;
295463b0 24-
be62a70f
ER
25 static void Spin(uv_idle_t* handle, int status) {
26 assert((uv_idle_t*) handle == &tick_spinner);
295463b0
ER
27 assert(status == 0);
28@@ -3077,11 +3074,6 @@ static char **copy_argv(int argc, char **argv) {
29
be62a70f
ER
30
31 int Start(int argc, char *argv[]) {
32- const char* replaceInvalid = getenv("NODE_INVALID_UTF8");
33-
34- if (replaceInvalid == NULL)
35- WRITE_UTF8_FLAGS |= String::REPLACE_INVALID_UTF8;
36-
37 // Hack aroung with the argv pointer. Used for process.title = "blah".
38 argv = uv_setup_args(argc, argv);
39
40diff --git a/src/string_bytes.cc b/src/string_bytes.cc
41index a7bab38..e4a34fe 100644
42--- a/src/string_bytes.cc
43+++ b/src/string_bytes.cc
44@@ -199,7 +199,7 @@ size_t StringBytes::Write(char* buf,
45 break;
46
47 case UTF8:
48- len = str->WriteUtf8(buf, buflen, chars_written, WRITE_UTF8_FLAGS);
49+ len = str->WriteUtf8(buf, buflen, chars_written, flags);
50 break;
51
52 case UCS2:
53diff --git a/src/string_bytes.h b/src/string_bytes.h
54index 31f04bb..8071a49 100644
55--- a/src/string_bytes.h
56+++ b/src/string_bytes.h
57@@ -29,8 +29,6 @@
58
59 namespace node {
60
61-extern int WRITE_UTF8_FLAGS;
62-
63 using v8::Handle;
64 using v8::Local;
65 using v8::String;
66diff --git a/test/simple/test-buffer.js b/test/simple/test-buffer.js
67index f8b2798..3026824 100644
68--- a/test/simple/test-buffer.js
69+++ b/test/simple/test-buffer.js
70@@ -791,18 +791,6 @@ assert.equal(buf[3], 0xFF);
71 assert.equal(buf[3], 0xFF);
72 });
73
74-// test unmatched surrogates not producing invalid utf8 output
75-// ef bf bd = utf-8 representation of unicode replacement character
76-// see https://codereview.chromium.org/121173009/
77-buf = new Buffer('ab\ud800cd', 'utf8');
78-assert.equal(buf[0], 0x61);
79-assert.equal(buf[1], 0x62);
80-assert.equal(buf[2], 0xef);
81-assert.equal(buf[3], 0xbf);
82-assert.equal(buf[4], 0xbd);
83-assert.equal(buf[5], 0x63);
84-assert.equal(buf[6], 0x64);
85-
86 // test for buffer overrun
87 buf = new Buffer([0, 0, 0, 0, 0]); // length: 5
88 var sub = buf.slice(0, 4); // length: 4
89--
901.9.3
91
This page took 0.047253 seconds and 4 git commands to generate.