summaryrefslogtreecommitdiff
path: root/ext/node/build.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-04-26 18:53:13 -0400
committerGitHub <noreply@github.com>2023-04-26 18:53:13 -0400
commita8b4e346b4477e340f36a59f83a0974afd541f4b (patch)
tree4a8cd39cc63fcec888e350509806de3b5121df85 /ext/node/build.rs
parent7415aff983333ae45badfd43c3db35d39ad37b79 (diff)
refactor(ext/node): use a snapshottable global name for Node's globalThis (#18860)
Diffstat (limited to 'ext/node/build.rs')
-rw-r--r--ext/node/build.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/node/build.rs b/ext/node/build.rs
new file mode 100644
index 000000000..e9b960cab
--- /dev/null
+++ b/ext/node/build.rs
@@ -0,0 +1,10 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
+fn main() {
+ // we use a changing variable name to make it harder to depend on this
+ let crate_version = env!("CARGO_PKG_VERSION");
+ println!(
+ "cargo:rustc-env=NODE_GLOBAL_THIS_NAME=__DENO_NODE_GLOBAL_THIS_{}__",
+ crate_version.replace('.', "_")
+ );
+}