src: support UTF-8 in compiled-in JS source files #11129

Merged
merged 2 commits into from Feb 13, 2017

Conversation

Projects
None yet
9 participants
@bnoordhuis
Member

bnoordhuis commented Feb 2, 2017

Detect it when source files in lib/ are not ASCII. Decode them as UTF-8
and store them as UTF-16 in the binary so they can be used as external
string resources without non-ASCII characters getting mangled.

CI: https://ci.nodejs.org/job/node-test-pull-request/6176/

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Feb 2, 2017

Member

I rather feared this approach may be a bit too forward-looking for some compilers... I'll see if I can dumb it down.

Member

bnoordhuis commented Feb 2, 2017

I rather feared this approach may be a bit too forward-looking for some compilers... I'll see if I can dumb it down.

tools/js2c.py
+ # Treat non-ASCII as UTF-8 and convert it to UTF-16.
+ if any(ord(c) > 127 for c in lines):
+ ctype = 'uint16_t'
+ data = map(ord, lines.decode('utf-8').encode('utf-16be'))

This comment has been minimized.

@aqrln

aqrln Feb 2, 2017

Member

Maybe 'utf-16be' if sys.byteorder == 'little' else 'utf-16le'?

@aqrln

aqrln Feb 2, 2017

Member

Maybe 'utf-16be' if sys.byteorder == 'little' else 'utf-16le'?

This comment has been minimized.

@bnoordhuis

bnoordhuis Feb 2, 2017

Member

The big-endian encoding is intentional, the line below stitches the individual octets together again into uint16s. (.encode() returns a byte string in case you're wondering.)

@bnoordhuis

bnoordhuis Feb 2, 2017

Member

The big-endian encoding is intentional, the line below stitches the individual octets together again into uint16s. (.encode() returns a byte string in case you're wondering.)

This comment has been minimized.

@aqrln

aqrln Feb 2, 2017

Member

Ah, I see. Right.

@aqrln

aqrln Feb 2, 2017

Member

Ah, I see. Right.

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Feb 2, 2017

Member

Just curious, have there been specific issues or is this purely preventative?

Member

jasnell commented Feb 2, 2017

Just curious, have there been specific issues or is this purely preventative?

@aqrln

This comment has been minimized.

Show comment
Hide comment
@aqrln

aqrln Feb 2, 2017

Member

@jasnell yes, reported in #10673

Member

aqrln commented Feb 2, 2017

@jasnell yes, reported in #10673

@gibfahn

This comment has been minimized.

Show comment
Hide comment
@gibfahn

gibfahn Feb 2, 2017

Member

What's the reason for using UTF-16 rather than UTF-8 (out of interest) to store the files in the binary?

Member

gibfahn commented Feb 2, 2017

What's the reason for using UTF-16 rather than UTF-8 (out of interest) to store the files in the binary?

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Feb 2, 2017

Member

I would have to assume it is because the external string API does not directly support UTF8. That is, if you look at ExternalStringResource, it assumes a utf16_t* buffer while ExternalOneByteStringResource assumes const char*. If the strings were stored as UTF8 we would incur an additional cost at startup that is not necessary.

Member

jasnell commented Feb 2, 2017

I would have to assume it is because the external string API does not directly support UTF8. That is, if you look at ExternalStringResource, it assumes a utf16_t* buffer while ExternalOneByteStringResource assumes const char*. If the strings were stored as UTF8 we would incur an additional cost at startup that is not necessary.

@aqrln

This comment has been minimized.

Show comment
Hide comment
@aqrln

aqrln Feb 2, 2017

Member

@gibfahn so that they can be used as external strings. UTF-8 strings must be copied to V8's managed memory. See #5458 by @bnoordhuis.

Member

aqrln commented Feb 2, 2017

@gibfahn so that they can be used as external strings. UTF-8 strings must be copied to V8's managed memory. See #5458 by @bnoordhuis.

src/node_javascript.cc
using v8::NewStringType;
using v8::Object;
using v8::String;
+template <typename T, size_t N, T P>

This comment has been minimized.

@addaleax

addaleax Feb 3, 2017

Member

Tiny suggestion: Could we be a bit more explicit and rename P to Ptr or Pointer? 😄

@addaleax

addaleax Feb 3, 2017

Member

Tiny suggestion: Could we be a bit more explicit and rename P to Ptr or Pointer? 😄

@aqrln

This comment has been minimized.

Show comment
Hide comment
@aqrln

aqrln Feb 3, 2017

Member

@bnoordhuis ping. Did you have time to dumb it down? 😉 This patch seems to work on GCC 4.8+.

Diff

diff --git a/src/node_javascript.cc b/src/node_javascript.cc
index 8c665381db..07a0daaa83 100644
--- a/src/node_javascript.cc
+++ b/src/node_javascript.cc
@@ -16,16 +16,16 @@ using v8::String;
 template <typename T, size_t N, T P>
 struct ExternalStringResource;
 
-template <size_t N, const char (&P)[N]>
-struct ExternalStringResource<const char[N], N, P>
+template <size_t N, const char* P>
+struct ExternalStringResource<const char*, N, P>
     : public String::ExternalOneByteStringResource {
   const char* data() const override { return P; }
   size_t length() const override { return N; }
   void Dispose() override { /* Default calls `delete this`. */ }
 };
 
-template <size_t N, const uint16_t (&P)[N]>
-struct ExternalStringResource<const uint16_t[N], N, P>
+template <size_t N, const uint16_t* P>
+struct ExternalStringResource<const uint16_t*, N, P>
     : public String::ExternalStringResource {
   const uint16_t* data() const override { return P; }
   size_t length() const override { return N; }
@@ -34,7 +34,7 @@ struct ExternalStringResource<const uint16_t[N], N, P>
 
 // id##_data is defined in node_natives.h.
 #define V(id) \
-  static ExternalStringResource<decltype(id##_data),                          \
+  static ExternalStringResource<decltype(&id##_data[0]),                      \
                                 arraysize(id##_data),                         \
                                 id##_data> id##_external_data;
 NODE_NATIVES_MAP(V)
diff --git a/tools/js2c.py b/tools/js2c.py
index e6c56cf075..8104e50e5a 100755
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -189,7 +189,7 @@ NODE_NATIVES_MAP = """\
 SOURCES = """\
 static const uint8_t {escaped_id}_name[] = {{
 {name}}};
-static const {ctype} {escaped_id}_data[] = {{
+static constexpr const {ctype} {escaped_id}_data[] = {{
 {data}}};
 """
 

Member

aqrln commented Feb 3, 2017

@bnoordhuis ping. Did you have time to dumb it down? 😉 This patch seems to work on GCC 4.8+.

Diff

diff --git a/src/node_javascript.cc b/src/node_javascript.cc
index 8c665381db..07a0daaa83 100644
--- a/src/node_javascript.cc
+++ b/src/node_javascript.cc
@@ -16,16 +16,16 @@ using v8::String;
 template <typename T, size_t N, T P>
 struct ExternalStringResource;
 
-template <size_t N, const char (&P)[N]>
-struct ExternalStringResource<const char[N], N, P>
+template <size_t N, const char* P>
+struct ExternalStringResource<const char*, N, P>
     : public String::ExternalOneByteStringResource {
   const char* data() const override { return P; }
   size_t length() const override { return N; }
   void Dispose() override { /* Default calls `delete this`. */ }
 };
 
-template <size_t N, const uint16_t (&P)[N]>
-struct ExternalStringResource<const uint16_t[N], N, P>
+template <size_t N, const uint16_t* P>
+struct ExternalStringResource<const uint16_t*, N, P>
     : public String::ExternalStringResource {
   const uint16_t* data() const override { return P; }
   size_t length() const override { return N; }
@@ -34,7 +34,7 @@ struct ExternalStringResource<const uint16_t[N], N, P>
 
 // id##_data is defined in node_natives.h.
 #define V(id) \
-  static ExternalStringResource<decltype(id##_data),                          \
+  static ExternalStringResource<decltype(&id##_data[0]),                      \
                                 arraysize(id##_data),                         \
                                 id##_data> id##_external_data;
 NODE_NATIVES_MAP(V)
diff --git a/tools/js2c.py b/tools/js2c.py
index e6c56cf075..8104e50e5a 100755
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -189,7 +189,7 @@ NODE_NATIVES_MAP = """\
 SOURCES = """\
 static const uint8_t {escaped_id}_name[] = {{
 {name}}};
-static const {ctype} {escaped_id}_data[] = {{
+static constexpr const {ctype} {escaped_id}_data[] = {{
 {data}}};
 """
 

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Feb 6, 2017

Member

@aqrln Thanks. I tried a couple of different approaches but I ended up settling for something that's pretty similar to your patch. :-)

I added a second commit that replaces a few U+2019 quotes with ASCII quotes so that their files can be stored as one-byte strings. Can I get a quick LGTM or two?

EDIT: The CI scoreboard is currently linking to a previous CI build. The correct one is https://ci.nodejs.org/job/node-test-commit/7713/.

Member

bnoordhuis commented Feb 6, 2017

@aqrln Thanks. I tried a couple of different approaches but I ended up settling for something that's pretty similar to your patch. :-)

I added a second commit that replaces a few U+2019 quotes with ASCII quotes so that their files can be stored as one-byte strings. Can I get a quick LGTM or two?

EDIT: The CI scoreboard is currently linking to a previous CI build. The correct one is https://ci.nodejs.org/job/node-test-commit/7713/.

@richardlau

This comment has been minimized.

Show comment
Hide comment
@richardlau

richardlau Feb 6, 2017

Member

I added a second commit that replaces a few U+2019 quotes with ASCII quotes so that their files can be stored as one-byte strings.

Probably one for another PR, but this sounds like a good candidate for a lint rule.

Member

richardlau commented Feb 6, 2017

I added a second commit that replaces a few U+2019 quotes with ASCII quotes so that their files can be stored as one-byte strings.

Probably one for another PR, but this sounds like a good candidate for a lint rule.

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Feb 6, 2017

Member

Interesting VS build failure...

an expression involving objects with internal linkage cannot be used as a non-type argument

I suppose the compiler is technically correct, and wasn't that the best kind of correct?

EDIT: New attempt: https://ci.nodejs.org/job/node-test-pull-request/6243/

Member

bnoordhuis commented Feb 6, 2017

Interesting VS build failure...

an expression involving objects with internal linkage cannot be used as a non-type argument

I suppose the compiler is technically correct, and wasn't that the best kind of correct?

EDIT: New attempt: https://ci.nodejs.org/job/node-test-pull-request/6243/

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Feb 11, 2017

Member

Different take: moved all the logic to js2c.py.

CI: https://ci.nodejs.org/job/node-test-pull-request/6357/

EDIT: Sigh...

node_javascript.cc(55276): error C2466: cannot allocate an array of constant size 0
Member

bnoordhuis commented Feb 11, 2017

Different take: moved all the logic to js2c.py.

CI: https://ci.nodejs.org/job/node-test-pull-request/6357/

EDIT: Sigh...

node_javascript.cc(55276): error C2466: cannot allocate an array of constant size 0
@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Feb 12, 2017

Member

CI is finally green except for that silly issue where the ARM buildbots don't report their status properly.

@addaleax The PR changed quite a bit, perhaps you want to take another look?

Member

bnoordhuis commented Feb 12, 2017

CI is finally green except for that silly issue where the ARM buildbots don't report their status properly.

@addaleax The PR changed quite a bit, perhaps you want to take another look?

'inputs': [
'<@(library_files)',
'./config.gypi',
],
'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/node_natives.h',
+ '<(SHARED_INTERMEDIATE_DIR)/node_javascript.cc',

This comment has been minimized.

@bnoordhuis

bnoordhuis Feb 12, 2017

Member

You'd expect INTERMEDIATE_DIR to work here but it doesn't: js2c generates the file but the build doesn't pick it up (and I updated the 'sources' list in case you're wondering.) I decided to leave well enough alone for now.

@bnoordhuis

bnoordhuis Feb 12, 2017

Member

You'd expect INTERMEDIATE_DIR to work here but it doesn't: js2c generates the file but the build doesn't pick it up (and I updated the 'sources' list in case you're wondering.) I decided to leave well enough alone for now.

bnoordhuis added some commits Feb 2, 2017

src: support UTF-8 in compiled-in JS source files
Detect it when source files in lib/ are not ASCII.  Decode them as UTF-8
and store them as UTF-16 in the binary so they can be used as external
string resources without non-ASCII characters getting mangled.

Fixes: #10673
PR-URL: #11129
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
lib: replace \u2019 with regular ascii quote
The previous commit stores baked-in files with non-ASCII characters
as UTF-16.  Replace the \u2019 with a regular quote character so that
the files they're in can be stored as one-byte strings.  The UTF-16
functionality is still tested by the Unicode diagram in lib/timers.js.

PR-URL: #11129
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>

@bnoordhuis bnoordhuis closed this Feb 13, 2017

@bnoordhuis bnoordhuis deleted the bnoordhuis:fix10673 branch Feb 13, 2017

@bnoordhuis bnoordhuis merged commit fd8587e into nodejs:master Feb 13, 2017

@thefourtheye thefourtheye referenced this pull request Feb 14, 2017

Closed

tools: add ASCII only lint rule in lib/ #11371

0 of 3 tasks complete

italoacasas added a commit to italoacasas/node that referenced this pull request Feb 14, 2017

src: support UTF-8 in compiled-in JS source files
Detect it when source files in lib/ are not ASCII.  Decode them as UTF-8
and store them as UTF-16 in the binary so they can be used as external
string resources without non-ASCII characters getting mangled.

Fixes: nodejs#10673
PR-URL: nodejs#11129
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>

italoacasas added a commit to italoacasas/node that referenced this pull request Feb 14, 2017

lib: replace \u2019 with regular ascii quote
The previous commit stores baked-in files with non-ASCII characters
as UTF-16.  Replace the \u2019 with a regular quote character so that
the files they're in can be stored as one-byte strings.  The UTF-16
functionality is still tested by the Unicode diagram in lib/timers.js.

PR-URL: nodejs#11129
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>

@aqrln aqrln referenced this pull request Feb 16, 2017

Closed

tools: make js2c.py strip comments from sources #11417

2 of 2 tasks complete

aqrln added a commit to aqrln/node that referenced this pull request Feb 16, 2017

tools: make js2c.py strip comments from sources
In order to allow using Unicode characters inside comments of built-in
JavaScript libraries without forcing them to be stored as UTF-16 data in
Node's binary, update the tooling to strip comments during build
process. All line breaks are preserved so that line numbers in stack
traces aren't broken.

Refs: nodejs#11129
Refs: nodejs#11371 (comment)

aqrln added a commit to aqrln/node that referenced this pull request Feb 16, 2017

test: add Unicode characters regression test
This test ensures that UTF-8 characters can be used in core JavaScript
modules built into Node's binary.

Refs: nodejs#11129

@aqrln aqrln referenced this pull request Feb 16, 2017

Closed

test: add Unicode characters regression test #11423

3 of 3 tasks complete

italoacasas added a commit that referenced this pull request Feb 16, 2017

2017-02-21, Version 7.6.0 (Current)
Notable changes:

* deps:
    * update V8 to 5.5 (Michaël Zasso) [#11029](#11029)
    * upgrade libuv to 1.11.0 (cjihrig) [#11094](#11094)
    * add node-inspect 1.10.2 (Jan Krems) [#10187](#10187)
* lib: build `node inspect` into `node` (Anna Henningsen) [#10187](#10187)
* crypto: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [#9469](#9469)
* inspector: add --inspect-brk (Josh Gavant) [#11149](#11149)
* fs: allow WHATWG URL and file: URLs as paths (James M Snell) [#10739](#10739)
* src: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [#11129](#11129)
* url: extend url.format to support WHATWG URL (James M Snell) [#10857](#10857)

PR-URL: #11185

addaleax added a commit that referenced this pull request Feb 21, 2017

2017-02-21, Version 7.6.0 (Current)
Notable changes:

* deps:
    * update V8 to 5.5 (Michaël Zasso) [#11029](#11029)
    * upgrade libuv to 1.11.0 (cjihrig) [#11094](#11094)
    * add node-inspect 1.10.4 (Jan Krems) [#10187](#10187)
* lib: build `node inspect` into `node` (Anna Henningsen) [#10187](#10187)
* crypto: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [#9469](#9469)
* inspector: add --inspect-brk (Josh Gavant) [#11149](#11149)
* fs: allow WHATWG URL objects as paths (James M Snell) [#10739](#10739)
* src: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [#11129](#11129)
* url: extend url.format to support WHATWG URL (James M Snell) [#10857](#10857)

PR-URL: #11185

italoacasas added a commit to italoacasas/node that referenced this pull request Feb 21, 2017

2017-02-21, Version 7.6.0 (Current)
Notable changes:

* deps:
    * update V8 to 5.5 (Michaël Zasso) [#11029](nodejs#11029)
    * upgrade libuv to 1.11.0 (cjihrig) [#11094](nodejs#11094)
    * add node-inspect 1.10.4 (Jan Krems) [#10187](nodejs#10187)
    * upgrade zlib to 1.2.11 (Sam Roberts) [#10980](nodejs#10980)
* lib: build `node inspect` into `node` (Anna Henningsen) [#10187](nodejs#10187)
* crypto: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [#9469](nodejs#9469)
* inspector: add --inspect-brk (Josh Gavant) [#11149](nodejs#11149)
* fs: allow WHATWG URL objects as paths (James M Snell) [#10739](nodejs#10739)
* src: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [#11129](nodejs#11129)
* url: extend url.format to support WHATWG URL (James M Snell) [#10857](nodejs#10857)

PR-URL: nodejs#11185

italoacasas added a commit to italoacasas/node that referenced this pull request Feb 22, 2017

2017-02-21, Version 7.6.0 (Current)
Notable changes:

* deps:
    * update V8 to 5.5 (Michaël Zasso) [#11029](nodejs#11029)
    * upgrade libuv to 1.11.0 (cjihrig) [#11094](nodejs#11094)
    * add node-inspect 1.10.4 (Jan Krems) [#10187](nodejs#10187)
    * upgrade zlib to 1.2.11 (Sam Roberts) [#10980](nodejs#10980)
* lib: build `node inspect` into `node` (Anna Henningsen) [#10187](nodejs#10187)
* crypto: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [#9469](nodejs#9469)
* inspector: add --inspect-brk (Josh Gavant) [#11149](nodejs#11149)
* fs: allow WHATWG URL objects as paths (James M Snell) [#10739](nodejs#10739)
* src: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [#11129](nodejs#11129)
* url: extend url.format to support WHATWG URL (James M Snell) [#10857](nodejs#10857)

PR-URL: nodejs#11185

imyller added a commit to imyller/meta-nodejs that referenced this pull request Mar 2, 2017

2017-02-21, Version 7.6.0 (Current)
    Notable changes:

    * deps:
        * update V8 to 5.5 (Michaël Zasso) [#11029](nodejs/node#11029)
        * upgrade libuv to 1.11.0 (cjihrig) [#11094](nodejs/node#11094)
        * add node-inspect 1.10.4 (Jan Krems) [#10187](nodejs/node#10187)
        * upgrade zlib to 1.2.11 (Sam Roberts) [#10980](nodejs/node#10980)
    * lib: build `node inspect` into `node` (Anna Henningsen) [#10187](nodejs/node#10187)
    * crypto: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [#9469](nodejs/node#9469)
    * inspector: add --inspect-brk (Josh Gavant) [#11149](nodejs/node#11149)
    * fs: allow WHATWG URL objects as paths (James M Snell) [#10739](nodejs/node#10739)
    * src: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [#11129](nodejs/node#11129)
    * url: extend url.format to support WHATWG URL (James M Snell) [#10857](nodejs/node#10857)

    PR-URL: nodejs/node#11185

Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>
@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Mar 7, 2017

Member

Needs a backport PR to land in v4.
Only one of the two commits was cherry-picked into v6 (the second one wasn't needed)

Member

jasnell commented Mar 7, 2017

Needs a backport PR to land in v4.
Only one of the two commits was cherry-picked into v6 (the second one wasn't needed)

jasnell added a commit that referenced this pull request Mar 7, 2017

src: support UTF-8 in compiled-in JS source files
Detect it when source files in lib/ are not ASCII.  Decode them as UTF-8
and store them as UTF-16 in the binary so they can be used as external
string resources without non-ASCII characters getting mangled.

Fixes: #10673
PR-URL: #11129
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>

MylesBorins added a commit that referenced this pull request Mar 9, 2017

src: support UTF-8 in compiled-in JS source files
Detect it when source files in lib/ are not ASCII.  Decode them as UTF-8
and store them as UTF-16 in the binary so they can be used as external
string resources without non-ASCII characters getting mangled.

Fixes: #10673
PR-URL: #11129
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>

@MylesBorins MylesBorins referenced this pull request Mar 9, 2017

Merged

v6.10.1 proposal #11759

jasnell added a commit that referenced this pull request Apr 4, 2017

test: add Unicode characters regression test
This test ensures that UTF-8 characters can be used in core JavaScript
modules built into Node's binary.

PR-URL: #11423
Ref: #11129
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

italoacasas added a commit to italoacasas/node that referenced this pull request Apr 10, 2017

test: add Unicode characters regression test
This test ensures that UTF-8 characters can be used in core JavaScript
modules built into Node's binary.

PR-URL: nodejs#11423
Ref: nodejs#11129
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@bridiver

This comment has been minimized.

Show comment
Hide comment
@bridiver

bridiver Apr 22, 2017

this causes error: use of undeclared identifier 'internal_bootstrap_node_value' for anything else that uses js2c.py

this causes error: use of undeclared identifier 'internal_bootstrap_node_value' for anything else that uses js2c.py

This comment has been minimized.

Show comment
Hide comment
@addaleax

addaleax Apr 22, 2017

Member

@bridiver Could you open a new issue, and maybe give an example of something else that uses it? If you want to have a generic way of turning file contents into C strings and use that for other project, it might be a better idea to use your own copy of this file (or its previous version)…

Member

addaleax replied Apr 22, 2017

@bridiver Could you open a new issue, and maybe give an example of something else that uses it? If you want to have a generic way of turning file contents into C strings and use that for other project, it might be a better idea to use your own copy of this file (or its previous version)…

This comment has been minimized.

Show comment
Hide comment
@bridiver

bridiver Apr 22, 2017

if this tool isn't meant for that purpose we can use v8's version of it

if this tool isn't meant for that purpose we can use v8's version of it

This comment has been minimized.

Show comment
Hide comment
@addaleax

addaleax Apr 22, 2017

Member

I think neither Node nor V8 considers it part of their public API, so I would still recommend using a copy it, but yes, V8’s version might work

Member

addaleax replied Apr 22, 2017

I think neither Node nor V8 considers it part of their public API, so I would still recommend using a copy it, but yes, V8’s version might work

@SirR4T SirR4T referenced this pull request Jan 10, 2018

Closed

tools: non-Ascii linter for /lib only #18043

2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment