Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix some compilation errors upstream
- Loading branch information
1 parent
5b137b6
commit 9c7a62d
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
patches/node/fix_explicitly_override_mark_arraybuffer_as_untransferable.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Shelley Vohr <shelley.vohr@gmail.com> | ||
Date: Wed, 12 Feb 2020 14:23:09 -0800 | ||
Subject: fix: explicitly override mark_arraybuffer_as_untransferable | ||
|
||
We need to mark overridden functions explicitly. This has already been | ||
fixed upstream at https://github.com/nodejs/node/pull/30549. | ||
|
||
diff --git a/src/node_api.cc b/src/node_api.cc | ||
index 0f7981cd5605ae2dad029b6bfb6a032afc09dfe0..5e467dded5bdb75a1831492b6b45c0d5eacab7f2 100644 | ||
--- a/src/node_api.cc | ||
+++ b/src/node_api.cc | ||
@@ -26,7 +26,7 @@ struct node_napi_env__ : public napi_env__ { | ||
} | ||
|
||
v8::Maybe<bool> mark_arraybuffer_as_untransferable( | ||
- v8::Local<v8::ArrayBuffer> ab) const { | ||
+ v8::Local<v8::ArrayBuffer> ab) const override { | ||
return ab->SetPrivate( | ||
context(), | ||
node_env()->arraybuffer_untransferable_private_symbol(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Shelley Vohr <shelley.vohr@gmail.com> | ||
Date: Wed, 12 Feb 2020 14:19:11 -0800 | ||
Subject: fix: use hex not decimal for clarity | ||
|
||
In Electron, clang enforces -Wxor-used-as-pow, so we should use hex | ||
here to clarify intent for the compiler. | ||
|
||
Upstreamed at https://github.com/nodejs/node/pull/31758. | ||
|
||
diff --git a/src/module_wrap.cc b/src/module_wrap.cc | ||
index b53aab6dc16c7ae42530998c94ddc845035b1256..c6aa5751a1bbaa693b915e418de8eb69ea8139f8 100644 | ||
--- a/src/module_wrap.cc | ||
+++ b/src/module_wrap.cc | ||
@@ -923,7 +923,7 @@ bool IsArrayIndex(Environment* env, Local<Value> p) { | ||
if (!n->ToInteger(context).ToLocal(&cmp_integer)) { | ||
return false; | ||
} | ||
- return n_dbl > 0 && n_dbl < (2 ^ 32) - 1; | ||
+ return n_dbl > 0 && n_dbl < (1LL << 32) - 1; | ||
} | ||
|
||
Maybe<URL> ResolveExportsTarget(Environment* env, |