react-nitro-hermes 0.0.1-alpha.8 → 0.0.1-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hermes/CMakeLists.txt +874 -0
- package/hermes/android/HostObjectJniTest.cpp +178 -0
- package/hermes/android/build-logic/build.gradle.kts +31 -0
- package/hermes/android/build-logic/settings.gradle.kts +17 -0
- package/hermes/android/build-logic/src/main/kotlin/com/facebook/hermes/helpers/internal/SerializeHermesCompilerPackageJson.kt +33 -0
- package/hermes/android/build-logic/src/main/kotlin/com/facebook/hermes/plugins/internal/TestUtilsPlugin.kt +80 -0
- package/hermes/android/build-logic/src/main/kotlin/com/facebook/hermes/tasks/internal/CustomExecTask.kt +46 -0
- package/hermes/android/build-logic/src/main/kotlin/publish.gradle.kts +82 -0
- package/hermes/android/build.gradle.kts +332 -0
- package/hermes/android/cppruntime/build.gradle +72 -0
- package/hermes/android/cppruntime/src/main/AndroidManifest.xml +2 -0
- package/hermes/android/cppruntime/src/main/cpp/CMakeLists.txt +8 -0
- package/hermes/android/cppruntime/src/main/cpp/stub.cpp +12 -0
- package/hermes/android/cross-compile/swift-libicu.patch +13 -0
- package/hermes/android/cross-compile/toolchain-android-arm-api13-gnustl.cmake +13 -0
- package/hermes/android/cross-compile/toolchain-android-arm-api15-gnustl.cmake +14 -0
- package/hermes/android/gradle/libs.versions.toml +30 -0
- package/hermes/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/hermes/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/hermes/android/gradle.properties +3 -0
- package/hermes/android/gradlew +248 -0
- package/hermes/android/gradlew.bat +93 -0
- package/hermes/android/intltest/build.gradle +147 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/CMakeLists.txt +45 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/HermesEpilogue.cpp +68 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/HermesEpilogue.h +44 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/HermesEpilogue.java +45 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/HermesEpilogueTestData.java +32 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/HermesInstrumentationTest.java +150 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/HermesIntlAndroidTest.java +147 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/HermesIntlTest262.java +470 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/HermesRuntimeFactory.cpp +73 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/JSRuntime.cpp +90 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/JSRuntime.h +62 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/JSRuntime.java +155 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/MappedFileBuffer.cpp +48 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/MappedFileBuffer.h +36 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/OnLoad.cpp +13 -0
- package/hermes/android/intltest/java/com/facebook/hermes/test/OnLoadEpilogue.cpp +13 -0
- package/hermes/android/intltest/src/main/AndroidManifest.xml +2 -0
- package/hermes/android/ios-artifacts/build.gradle.kts +65 -0
- package/hermes/android/settings.gradle.kts +27 -0
- package/hermes/cmake/modules/Hermes.cmake +481 -0
- package/hermes/cmake/modules/Lit.cmake +96 -0
- package/hermes/doc/Branches.md +38 -0
- package/hermes/doc/BuildingAndRunning.md +121 -0
- package/hermes/doc/CodingStandards.md +112 -0
- package/hermes/doc/CrossCompilation.md +79 -0
- package/hermes/doc/Design.md +217 -0
- package/hermes/doc/Emscripten.md +156 -0
- package/hermes/doc/Features.md +143 -0
- package/hermes/doc/GCSafeCoding.md +563 -0
- package/hermes/doc/GenGC.md +300 -0
- package/hermes/doc/Hades.md +344 -0
- package/hermes/doc/HighLevelOptimizations.md +37 -0
- package/hermes/doc/IR.md +1306 -0
- package/hermes/doc/IntlAPIs.md +196 -0
- package/hermes/doc/JIT.md +999 -0
- package/hermes/doc/LazyEvalCompilation.md +84 -0
- package/hermes/doc/MemoryProfilers.md +316 -0
- package/hermes/doc/Modules.md +144 -0
- package/hermes/doc/Optimizer.md +83 -0
- package/hermes/doc/PerfProfiling.md +29 -0
- package/hermes/doc/ProhibitInvoke.md +329 -0
- package/hermes/doc/ReactNative.md +40 -0
- package/hermes/doc/ReactNativeIntegration.md +94 -0
- package/hermes/doc/RegExp.md +24 -0
- package/hermes/doc/SpecIncompat.md +85 -0
- package/hermes/doc/Strings.md +140 -0
- package/hermes/doc/TypedLanguage.md +432 -0
- package/hermes/doc/VM.md +174 -0
- package/hermes/doc/blog/2024-11-09-octane-benchmark-jit-progress.md +17 -0
- package/hermes/doc/blog/2024-12-19-static-hermes-update-dec-2024.md +47 -0
- package/hermes/doc/blog/2024-12-23-compiling-javascript-to-wasm.md +267 -0
- package/hermes/doc/blog/2025-06-09-jsi-runtime-data-apis.md +23 -0
- package/hermes/doc/blog/2025-07-15-static-h-performance-june-2025.md +18 -0
- package/hermes/doc/blog/2025-11-02-hermes-compilation-runtime-modes.md +23 -0
- package/hermes/doc/blog/2025-11-06-hermes-memory-modes.md +35 -0
- package/hermes/doc/blog/2025-11-24-json-parsing-performance.md +17 -0
- package/hermes/doc/blog/2025-12-02-iserialization.md +11 -0
- package/hermes/doc/blog/2025-12-12-new-way-to-contribute.md +68 -0
- package/hermes/doc/blog/2026-06-05-new-hermes-stable-release.md +51 -0
- package/hermes/doc/blog/README.md +25 -0
- package/hermes/doc/blog/images/2024-11-09-octane-pi3.jpeg +0 -0
- package/hermes/doc/blog/images/2024-11-09-octane-pi5.jpeg +0 -0
- package/hermes/doc/blog/images/2025-07-15-perf-hv32-interpreter.jpeg +0 -0
- package/hermes/doc/blog/images/2025-07-15-perf-hv32-jit.jpeg +0 -0
- package/hermes/doc/icu_license.txt +420 -0
- package/hermes/doc/img/heap_snapshot_retainers.png +0 -0
- package/hermes/doc/img/logo.svg +1 -0
- package/hermes/doc/img/object_captured_by_environment.png +0 -0
- package/hermes/doc/img/root_categories.png +0 -0
- package/hermes/doc/plans/ir-type/flow-type-system.md +324 -0
- package/hermes/doc/plans/ir-type/ir-type-system-v2-design.md +652 -0
- package/hermes/doc/plans/ir-type/ir-type-system.md +220 -0
- package/hermes/doc/plans/ir-type/ir-type-v2-implementation.md +1187 -0
- package/hermes/doc/plans/ir-type/memory.md +48 -0
- package/hermes/doc/plans/ir-type/phase1-steps.md +512 -0
- package/hermes/doc/plans/ir-type/progress.md +239 -0
- package/hermes/doc/plans/ir-type/typeinference-primitive-fastpath-design.md +203 -0
- package/hermes/doc/plans/ir-type/typeinference-primitive-fastpath-results.md +71 -0
- package/hermes/doc/superpowers/plans/2026-07-28-worker-arraybuffer-input.md +597 -0
- package/hermes/doc/superpowers/plans/2026-08-18-jitemitter-split.md +1149 -0
- package/hermes/doc/superpowers/plans/2026-08-20-jit-type-asserts.md +969 -0
- package/hermes/doc/superpowers/plans/2026-08-23-jit-shared-compiler-driver.md +478 -0
- package/hermes/doc/superpowers/plans/2026-08-23-x86-64-jit-skeleton.md +797 -0
- package/hermes/doc/superpowers/plans/2026-08-24-x86-64-jit-arith.md +444 -0
- package/hermes/doc/superpowers/plans/2026-08-24-x86-64-jit-calls.md +261 -0
- package/hermes/doc/superpowers/plans/2026-08-24-x86-64-jit-props.md +240 -0
- package/hermes/doc/superpowers/plans/2026-10-26-regexp-bytecode-sharing.md +2197 -0
- package/hermes/doc/superpowers/plans/2026-10-28-regexp-start-filter-and-exec-fast-paths.md +3981 -0
- package/hermes/doc/superpowers/specs/2026-07-28-worker-arraybuffer-input-design.md +206 -0
- package/hermes/doc/superpowers/specs/2026-08-18-jitemitter-split-design.md +530 -0
- package/hermes/doc/superpowers/specs/2026-08-20-jit-type-asserts-design.md +360 -0
- package/hermes/doc/superpowers/specs/2026-08-23-x86-64-jit-design.md +246 -0
- package/hermes/doc/superpowers/specs/2026-08-26-icu-free-normalize-design.md +355 -0
- package/hermes/doc/superpowers/specs/2026-08-27-icu-free-convert-to-case-design.md +305 -0
- package/hermes/doc/superpowers/specs/2026-08-27-icu-free-locale-compare-design.md +429 -0
- package/hermes/doc/superpowers/specs/2026-08-29-icu-free-date-format-design.md +297 -0
- package/hermes/doc/superpowers/specs/2026-10-26-regexp-bytecode-sharing-design.md +605 -0
- package/hermes/doc/superpowers/specs/2026-10-28-regexp-start-filter-and-exec-fast-paths-design.md +551 -0
- package/hermes/doc/typescript-stripping.md +90 -0
- package/hermes/external/CMakeLists.txt +20 -0
- package/hermes/utils/IntlGen/IntlGen.java +531 -0
- package/hermes/utils/bench_with_stats.py +827 -0
- package/hermes/utils/build-apple-framework.sh +323 -0
- package/hermes/utils/chrome_snapshot_parser.py +210 -0
- package/hermes/utils/cmake-dev-build.sh +18 -0
- package/hermes/utils/commons.sh +55 -0
- package/hermes/utils/dump-cpp-funcs.sh +3 -0
- package/hermes/utils/es5objects.js +198 -0
- package/hermes/utils/format.sh +145 -0
- package/hermes/utils/gen-promise-internal-bc.sh +66 -0
- package/hermes/utils/genUnicodeTable.py +2503 -0
- package/hermes/utils/hermes-lit/CMakeLists.txt +22 -0
- package/hermes/utils/hermes-lit/hermes-lit.in +15 -0
- package/hermes/utils/jit/README.md +134 -0
- package/hermes/utils/jit/jit-diff.sh +160 -0
- package/hermes/utils/jit/jit-dump.sh +193 -0
- package/hermes/utils/lit-expect-gen/generate.py +217 -0
- package/hermes/utils/promise/index.js +15 -0
- package/hermes/utils/promise/package.json +13 -0
- package/hermes/utils/promise/rollup.config.js +19 -0
- package/hermes/utils/promise/yarn.lock +247 -0
- package/hermes/utils/scripts/hermes/consts.js +26 -0
- package/hermes/utils/scripts/hermes/create-tarball.js +75 -0
- package/hermes/utils/scripts/hermes/get-hermes-version.js +57 -0
- package/hermes/utils/scripts/hermes/hermes-utils.js +122 -0
- package/hermes/utils/scripts/hermes/package.json +6 -0
- package/hermes/utils/scripts/hermes/prepare-artifacts.js +113 -0
- package/hermes/utils/scripts/hermes/publish-artifacts.js +109 -0
- package/hermes/utils/scripts/hermes/publish-npm.js +96 -0
- package/hermes/utils/scripts/hermes/scm-utils.js +41 -0
- package/hermes/utils/scripts/hermes/set-artifacts-version.js +64 -0
- package/hermes/utils/scripts/hermes/version-utils.js +98 -0
- package/hermes/utils/scripts/hermes/yarn.lock +240 -0
- package/hermes/utils/summarize_sizes.py +184 -0
- package/hermes/utils/symbolicate-nativecall-stats.py +112 -0
- package/hermes/utils/test_runner.py +13 -0
- package/hermes/utils/testsuite/README.facebook +3 -0
- package/hermes/utils/testsuite/README.md +69 -0
- package/hermes/utils/testsuite/cli.py +547 -0
- package/hermes/utils/testsuite/es_ast.py +337 -0
- package/hermes/utils/testsuite/external/LICENSE +28 -0
- package/hermes/utils/testsuite/external/README.facebook +8 -0
- package/hermes/utils/testsuite/external/__init__.py +0 -0
- package/hermes/utils/testsuite/external/_monkeyYaml.py +164 -0
- package/hermes/utils/testsuite/external/parse_test262.py +141 -0
- package/hermes/utils/testsuite/hermes.py +522 -0
- package/hermes/utils/testsuite/preprocess.py +365 -0
- package/hermes/utils/testsuite/progress.py +377 -0
- package/hermes/utils/testsuite/skiplist.json +4356 -0
- package/hermes/utils/testsuite/skiplist.py +270 -0
- package/hermes/utils/testsuite/test_run_defs.py +435 -0
- package/hermes/utils/testsuite/typing_defs.py +52 -0
- package/hermes/utils/testsuite/utils.py +214 -0
- package/hermes/utils/tidy.sh +22 -0
- package/hermes/utils/update-fbcode-hermes.sh +53 -0
- package/hermes/utils/updateErrorTest.py +193 -0
- package/hermes/utils/wasm-compile.sh +65 -0
- package/package.json +1 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
"""Test expectation generation.
|
|
7
|
+
|
|
8
|
+
Use this script for regenerating the expectations in tests that use the
|
|
9
|
+
%FileCheckOrRegen lit substitution.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import argparse
|
|
13
|
+
import os
|
|
14
|
+
import re
|
|
15
|
+
import sys
|
|
16
|
+
|
|
17
|
+
_ES5_FUNCTION = "function"
|
|
18
|
+
_ES6_CONSTRUCTOR = "constructor"
|
|
19
|
+
_ES6_ARROW = "arrow"
|
|
20
|
+
_ES6_ARROW_FUNCTION = "arrow function"
|
|
21
|
+
_ES6_METHOD = "method"
|
|
22
|
+
|
|
23
|
+
_DUMP_FUNCTION_START_MARKERS = [
|
|
24
|
+
_ES5_FUNCTION,
|
|
25
|
+
_ES6_CONSTRUCTOR,
|
|
26
|
+
_ES6_ARROW,
|
|
27
|
+
_ES6_ARROW_FUNCTION,
|
|
28
|
+
_ES6_METHOD,
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
_DUMP_FUNCTION_END_MARKER = "function_end"
|
|
32
|
+
|
|
33
|
+
_SOURCE_LOCATION_PREFIX_MARKER = "source location: ["
|
|
34
|
+
_SOURCE_LOCATION_RANGE_SEP = " ... "
|
|
35
|
+
_SOURCE_LOCATION_SUFFIX_MARKER = ")"
|
|
36
|
+
|
|
37
|
+
_INST_LOCATION_PREFIX = "; "
|
|
38
|
+
|
|
39
|
+
_LOCATION_SEP = ":"
|
|
40
|
+
|
|
41
|
+
_AUTO_GENERATED_MARKER = (
|
|
42
|
+
"// Auto-generated content below. Please do not modify manually."
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class SourceLocation:
|
|
47
|
+
"""Represents a source location in the compiler output.
|
|
48
|
+
|
|
49
|
+
The hermes compiler sometimes outputs source locations (when the
|
|
50
|
+
--dump-source-locations flag is set). Those locations potentially
|
|
51
|
+
include absolute paths that should not appear in the expectations.
|
|
52
|
+
Therefore, this class decodes a source location coming from the
|
|
53
|
+
compiler, and it provides helpers to ensure the auto-generated
|
|
54
|
+
expectations work properly (e.g., /full/path/to/file.js becomes
|
|
55
|
+
{{.*}}file.js).
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
def __init__(self, loc):
|
|
59
|
+
column_index = loc.rfind(_LOCATION_SEP, 0)
|
|
60
|
+
line_index = loc.rfind(_LOCATION_SEP, 0, column_index)
|
|
61
|
+
if line_index == -1:
|
|
62
|
+
raise Exception(f"Unrecognized location format {loc}")
|
|
63
|
+
self.filename = os.path.basename(loc[:line_index])
|
|
64
|
+
self.line = int(loc[line_index + 1 : column_index])
|
|
65
|
+
self.column = int(loc[column_index + 1 :])
|
|
66
|
+
|
|
67
|
+
def to_check_payload(self):
|
|
68
|
+
"""Returns a string that can be used in lit expectations."""
|
|
69
|
+
return f"{{{{.*}}}}{self}"
|
|
70
|
+
|
|
71
|
+
def __lt__(self, other):
|
|
72
|
+
assert self.filename == other.filename, f"{self} vs {other}"
|
|
73
|
+
return (self.line < other.line) or (
|
|
74
|
+
self.line == other.line and self.column < other.column
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
def __eq__(self, other):
|
|
78
|
+
return (
|
|
79
|
+
self.filename == other.filename
|
|
80
|
+
and self.line == other.line
|
|
81
|
+
and self.column == other.column
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
def __le__(self, other):
|
|
85
|
+
return self == other or self < other
|
|
86
|
+
|
|
87
|
+
def __str__(self):
|
|
88
|
+
return f"{self.filename}{_LOCATION_SEP}{self.line}{_LOCATION_SEP}{self.column}"
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
class CompilerOutput:
|
|
92
|
+
"""Manages the compiler output.
|
|
93
|
+
|
|
94
|
+
This class is used as a "container" for the compiler output from which
|
|
95
|
+
the test expectations are generated.
|
|
96
|
+
"""
|
|
97
|
+
|
|
98
|
+
def __init__(self, js_file, check_prefix):
|
|
99
|
+
self.check_prefix = check_prefix
|
|
100
|
+
self.js_file_location = os.path.join(os.path.dirname(js_file), "")
|
|
101
|
+
self.emit_check_next = False
|
|
102
|
+
self.lines = []
|
|
103
|
+
|
|
104
|
+
def add_line(self, line):
|
|
105
|
+
if not line:
|
|
106
|
+
self.emit_check_next = False
|
|
107
|
+
if self.lines and self.lines[-1]:
|
|
108
|
+
self.lines.append("")
|
|
109
|
+
return
|
|
110
|
+
src_hash_regex = r"(^\s*Source hash:) (\d|[a-z]){40}$"
|
|
111
|
+
hash_match = re.search(src_hash_regex, line)
|
|
112
|
+
if hash_match is not None:
|
|
113
|
+
source_hash_wildcard = (
|
|
114
|
+
f"// {self.check_prefix}-NEXT:" + hash_match.group(1) + " {{.*}}"
|
|
115
|
+
)
|
|
116
|
+
self.lines.append(source_hash_wildcard)
|
|
117
|
+
return
|
|
118
|
+
bc_version_regex = r"(^\s*Bytecode version number:) (\d+)$"
|
|
119
|
+
bc_match = re.search(bc_version_regex, line)
|
|
120
|
+
if bc_match is not None:
|
|
121
|
+
source_hash_wildcard = (
|
|
122
|
+
f"// {self.check_prefix}-NEXT:" + bc_match.group(1) + " {{.*}}"
|
|
123
|
+
)
|
|
124
|
+
self.lines.append(source_hash_wildcard)
|
|
125
|
+
return
|
|
126
|
+
|
|
127
|
+
if self.emit_check_next:
|
|
128
|
+
self.lines.append(f"// {self.check_prefix}-NEXT:")
|
|
129
|
+
else:
|
|
130
|
+
self.lines.append(f"// {self.check_prefix}:")
|
|
131
|
+
self.emit_check_next = True
|
|
132
|
+
|
|
133
|
+
if self.js_file_location:
|
|
134
|
+
start = line.find(self.js_file_location)
|
|
135
|
+
while start != -1:
|
|
136
|
+
line = (
|
|
137
|
+
line[:start] + "{{.*}}" + line[start + len(self.js_file_location) :]
|
|
138
|
+
)
|
|
139
|
+
start = line.find(self.js_file_location)
|
|
140
|
+
|
|
141
|
+
self.lines[-1] += f"{line}"
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def _parse_command_line():
|
|
145
|
+
"""Parses a FileCheck-like command line.
|
|
146
|
+
|
|
147
|
+
This function parses the scripts command line argument, and exposes some
|
|
148
|
+
options that are also present in FileCheck. This way, whenever the golden
|
|
149
|
+
outputs need to be updated, all that's needed is to replace the command
|
|
150
|
+
used in the %GoldenCheck lit substitution.
|
|
151
|
+
"""
|
|
152
|
+
|
|
153
|
+
p = argparse.ArgumentParser()
|
|
154
|
+
|
|
155
|
+
p.add_argument("js_file")
|
|
156
|
+
|
|
157
|
+
# The prefix to be checked for (the --check-prefix command line option in
|
|
158
|
+
# FileCheck) is expected to be part of the golden output file.
|
|
159
|
+
p.add_argument("--check-prefix", "-check-prefix", default="CHECK")
|
|
160
|
+
|
|
161
|
+
# Sometimes the golden output tests use the following options, so they are
|
|
162
|
+
# added here so this script can be used as a drop in replacement for the
|
|
163
|
+
# FileCheck utility.
|
|
164
|
+
p.add_argument(
|
|
165
|
+
"--match-full-lines",
|
|
166
|
+
"-match-full-lines",
|
|
167
|
+
default=False,
|
|
168
|
+
action="store_true",
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
return p.parse_args()
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def main(args):
|
|
175
|
+
print(f"Generating {args.js_file} ...")
|
|
176
|
+
|
|
177
|
+
# First step is parsing the compiler output and building the
|
|
178
|
+
# intermediate representation -- i.e., the [Function] list. It
|
|
179
|
+
# is important to exhaust stdin first in case the compiler output
|
|
180
|
+
# has been piped to this script.
|
|
181
|
+
compiler_output = CompilerOutput(args.js_file, args.check_prefix)
|
|
182
|
+
for line in sys.stdin:
|
|
183
|
+
compiler_output.add_line(line.rstrip())
|
|
184
|
+
|
|
185
|
+
while compiler_output.lines and not compiler_output.lines[-1]:
|
|
186
|
+
compiler_output.lines.pop()
|
|
187
|
+
|
|
188
|
+
# Now it is time to parse the input .js file and append it to the functions.
|
|
189
|
+
js_lines = []
|
|
190
|
+
with open(args.js_file, "r") as jsf:
|
|
191
|
+
for line in jsf:
|
|
192
|
+
if not re.match(f"\\s*//\\s*{args.check_prefix}", line):
|
|
193
|
+
line = line.rstrip()
|
|
194
|
+
if line or (js_lines and js_lines[-1]):
|
|
195
|
+
js_lines.append(line)
|
|
196
|
+
|
|
197
|
+
# And now drop empty lines at the end of the js file
|
|
198
|
+
while not js_lines[-1]:
|
|
199
|
+
js_lines.pop()
|
|
200
|
+
|
|
201
|
+
# Now update the test file.
|
|
202
|
+
with open(args.js_file, "w") as jsf:
|
|
203
|
+
has_auto_generated_marker = False
|
|
204
|
+
for line in js_lines:
|
|
205
|
+
print(line, file=jsf)
|
|
206
|
+
has_auto_generated_marker = (
|
|
207
|
+
has_auto_generated_marker or line == _AUTO_GENERATED_MARKER
|
|
208
|
+
)
|
|
209
|
+
if not has_auto_generated_marker:
|
|
210
|
+
print(f"\n{_AUTO_GENERATED_MARKER}", file=jsf)
|
|
211
|
+
print(file=jsf)
|
|
212
|
+
for line in compiler_output.lines:
|
|
213
|
+
print(line, file=jsf)
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
if __name__ == "__main__":
|
|
217
|
+
main(_parse_command_line())
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @nolint
|
|
2
|
+
// This file is used to generate InternalBytecode/Promise.js
|
|
3
|
+
// See InternalBytecode/README.md for more details.
|
|
4
|
+
|
|
5
|
+
const Promise = require('promise/setimmediate/es6-extensions');
|
|
6
|
+
|
|
7
|
+
require('promise/setimmediate/finally');
|
|
8
|
+
|
|
9
|
+
// expose Promise to global.
|
|
10
|
+
globalThis.Promise = Promise;
|
|
11
|
+
|
|
12
|
+
// register the JavaScript implemented `enable` function into
|
|
13
|
+
// the Hermes' internal promise rejection tracker.
|
|
14
|
+
var enableHook = require('promise/setimmediate/rejection-tracking').enable
|
|
15
|
+
HermesInternal?.setPromiseRejectionTrackingHook?.(enableHook);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dependencies": {
|
|
3
|
+
"@rollup/plugin-commonjs": "~15.0.0",
|
|
4
|
+
"@rollup/plugin-node-resolve": "~9.0.0",
|
|
5
|
+
"promise": "8.3.0"
|
|
6
|
+
},
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "yarn run rollup --config rollup.config.js index.js"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"rollup": "~2.27.0"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
9
|
+
import { nodeResolve } from '@rollup/plugin-node-resolve'
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
input: './index.js',
|
|
13
|
+
output: {
|
|
14
|
+
name: 'initPromise',
|
|
15
|
+
file: 'Promise.js',
|
|
16
|
+
format: 'iife'
|
|
17
|
+
},
|
|
18
|
+
plugins: [nodeResolve(), commonjs()]
|
|
19
|
+
};
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
# yarn lockfile v1
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
"@rollup/plugin-commonjs@~15.0.0":
|
|
6
|
+
version "15.0.0"
|
|
7
|
+
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-15.0.0.tgz#690d15a9d54ba829db93555bff9b98ff34e08574"
|
|
8
|
+
integrity sha512-8uAdikHqVyrT32w1zB9VhW6uGwGjhKgnDNP4pQJsjdnyF4FgCj6/bmv24c7v2CuKhq32CcyCwRzMPEElaKkn0w==
|
|
9
|
+
dependencies:
|
|
10
|
+
"@rollup/pluginutils" "^3.1.0"
|
|
11
|
+
commondir "^1.0.1"
|
|
12
|
+
estree-walker "^2.0.1"
|
|
13
|
+
glob "^7.1.6"
|
|
14
|
+
is-reference "^1.2.1"
|
|
15
|
+
magic-string "^0.25.7"
|
|
16
|
+
resolve "^1.17.0"
|
|
17
|
+
|
|
18
|
+
"@rollup/plugin-node-resolve@~9.0.0":
|
|
19
|
+
version "9.0.0"
|
|
20
|
+
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz#39bd0034ce9126b39c1699695f440b4b7d2b62e6"
|
|
21
|
+
integrity sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg==
|
|
22
|
+
dependencies:
|
|
23
|
+
"@rollup/pluginutils" "^3.1.0"
|
|
24
|
+
"@types/resolve" "1.17.1"
|
|
25
|
+
builtin-modules "^3.1.0"
|
|
26
|
+
deepmerge "^4.2.2"
|
|
27
|
+
is-module "^1.0.0"
|
|
28
|
+
resolve "^1.17.0"
|
|
29
|
+
|
|
30
|
+
"@rollup/pluginutils@^3.1.0":
|
|
31
|
+
version "3.1.0"
|
|
32
|
+
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b"
|
|
33
|
+
integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==
|
|
34
|
+
dependencies:
|
|
35
|
+
"@types/estree" "0.0.39"
|
|
36
|
+
estree-walker "^1.0.1"
|
|
37
|
+
picomatch "^2.2.2"
|
|
38
|
+
|
|
39
|
+
"@types/estree@*":
|
|
40
|
+
version "1.0.0"
|
|
41
|
+
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2"
|
|
42
|
+
integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==
|
|
43
|
+
|
|
44
|
+
"@types/estree@0.0.39":
|
|
45
|
+
version "0.0.39"
|
|
46
|
+
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
|
|
47
|
+
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
|
|
48
|
+
|
|
49
|
+
"@types/node@*":
|
|
50
|
+
version "18.7.14"
|
|
51
|
+
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.14.tgz#0fe081752a3333392d00586d815485a17c2cf3c9"
|
|
52
|
+
integrity sha512-6bbDaETVi8oyIARulOE9qF1/Qdi/23z6emrUh0fNJRUmjznqrixD4MpGDdgOFk5Xb0m2H6Xu42JGdvAxaJR/wA==
|
|
53
|
+
|
|
54
|
+
"@types/resolve@1.17.1":
|
|
55
|
+
version "1.17.1"
|
|
56
|
+
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6"
|
|
57
|
+
integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==
|
|
58
|
+
dependencies:
|
|
59
|
+
"@types/node" "*"
|
|
60
|
+
|
|
61
|
+
asap@~2.0.6:
|
|
62
|
+
version "2.0.6"
|
|
63
|
+
resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46"
|
|
64
|
+
integrity sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==
|
|
65
|
+
|
|
66
|
+
balanced-match@^1.0.0:
|
|
67
|
+
version "1.0.2"
|
|
68
|
+
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
|
|
69
|
+
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
|
|
70
|
+
|
|
71
|
+
brace-expansion@^1.1.7:
|
|
72
|
+
version "1.1.11"
|
|
73
|
+
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
|
|
74
|
+
integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
|
|
75
|
+
dependencies:
|
|
76
|
+
balanced-match "^1.0.0"
|
|
77
|
+
concat-map "0.0.1"
|
|
78
|
+
|
|
79
|
+
builtin-modules@^3.1.0:
|
|
80
|
+
version "3.3.0"
|
|
81
|
+
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6"
|
|
82
|
+
integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==
|
|
83
|
+
|
|
84
|
+
commondir@^1.0.1:
|
|
85
|
+
version "1.0.1"
|
|
86
|
+
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
|
|
87
|
+
integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==
|
|
88
|
+
|
|
89
|
+
concat-map@0.0.1:
|
|
90
|
+
version "0.0.1"
|
|
91
|
+
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
|
92
|
+
integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==
|
|
93
|
+
|
|
94
|
+
deepmerge@^4.2.2:
|
|
95
|
+
version "4.2.2"
|
|
96
|
+
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955"
|
|
97
|
+
integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==
|
|
98
|
+
|
|
99
|
+
estree-walker@^1.0.1:
|
|
100
|
+
version "1.0.1"
|
|
101
|
+
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700"
|
|
102
|
+
integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==
|
|
103
|
+
|
|
104
|
+
estree-walker@^2.0.1:
|
|
105
|
+
version "2.0.2"
|
|
106
|
+
resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac"
|
|
107
|
+
integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==
|
|
108
|
+
|
|
109
|
+
fs.realpath@^1.0.0:
|
|
110
|
+
version "1.0.0"
|
|
111
|
+
resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
|
|
112
|
+
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
|
|
113
|
+
|
|
114
|
+
fsevents@~2.1.2:
|
|
115
|
+
version "2.1.3"
|
|
116
|
+
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e"
|
|
117
|
+
integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==
|
|
118
|
+
|
|
119
|
+
function-bind@^1.1.1:
|
|
120
|
+
version "1.1.1"
|
|
121
|
+
resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
|
|
122
|
+
integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==
|
|
123
|
+
|
|
124
|
+
glob@^7.1.6:
|
|
125
|
+
version "7.2.3"
|
|
126
|
+
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
|
|
127
|
+
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
|
|
128
|
+
dependencies:
|
|
129
|
+
fs.realpath "^1.0.0"
|
|
130
|
+
inflight "^1.0.4"
|
|
131
|
+
inherits "2"
|
|
132
|
+
minimatch "^3.1.1"
|
|
133
|
+
once "^1.3.0"
|
|
134
|
+
path-is-absolute "^1.0.0"
|
|
135
|
+
|
|
136
|
+
has@^1.0.3:
|
|
137
|
+
version "1.0.3"
|
|
138
|
+
resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796"
|
|
139
|
+
integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==
|
|
140
|
+
dependencies:
|
|
141
|
+
function-bind "^1.1.1"
|
|
142
|
+
|
|
143
|
+
inflight@^1.0.4:
|
|
144
|
+
version "1.0.6"
|
|
145
|
+
resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
|
|
146
|
+
integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==
|
|
147
|
+
dependencies:
|
|
148
|
+
once "^1.3.0"
|
|
149
|
+
wrappy "1"
|
|
150
|
+
|
|
151
|
+
inherits@2:
|
|
152
|
+
version "2.0.4"
|
|
153
|
+
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
|
|
154
|
+
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
|
|
155
|
+
|
|
156
|
+
is-core-module@^2.9.0:
|
|
157
|
+
version "2.10.0"
|
|
158
|
+
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.10.0.tgz#9012ede0a91c69587e647514e1d5277019e728ed"
|
|
159
|
+
integrity sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==
|
|
160
|
+
dependencies:
|
|
161
|
+
has "^1.0.3"
|
|
162
|
+
|
|
163
|
+
is-module@^1.0.0:
|
|
164
|
+
version "1.0.0"
|
|
165
|
+
resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591"
|
|
166
|
+
integrity sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==
|
|
167
|
+
|
|
168
|
+
is-reference@^1.2.1:
|
|
169
|
+
version "1.2.1"
|
|
170
|
+
resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7"
|
|
171
|
+
integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==
|
|
172
|
+
dependencies:
|
|
173
|
+
"@types/estree" "*"
|
|
174
|
+
|
|
175
|
+
magic-string@^0.25.7:
|
|
176
|
+
version "0.25.9"
|
|
177
|
+
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c"
|
|
178
|
+
integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ==
|
|
179
|
+
dependencies:
|
|
180
|
+
sourcemap-codec "^1.4.8"
|
|
181
|
+
|
|
182
|
+
minimatch@^3.1.1:
|
|
183
|
+
version "3.1.2"
|
|
184
|
+
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b"
|
|
185
|
+
integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==
|
|
186
|
+
dependencies:
|
|
187
|
+
brace-expansion "^1.1.7"
|
|
188
|
+
|
|
189
|
+
once@^1.3.0:
|
|
190
|
+
version "1.4.0"
|
|
191
|
+
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
|
|
192
|
+
integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==
|
|
193
|
+
dependencies:
|
|
194
|
+
wrappy "1"
|
|
195
|
+
|
|
196
|
+
path-is-absolute@^1.0.0:
|
|
197
|
+
version "1.0.1"
|
|
198
|
+
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
|
199
|
+
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==
|
|
200
|
+
|
|
201
|
+
path-parse@^1.0.7:
|
|
202
|
+
version "1.0.7"
|
|
203
|
+
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
|
|
204
|
+
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
|
|
205
|
+
|
|
206
|
+
picomatch@^2.2.2:
|
|
207
|
+
version "2.3.1"
|
|
208
|
+
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
|
|
209
|
+
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
|
|
210
|
+
|
|
211
|
+
promise@8.3.0:
|
|
212
|
+
version "8.3.0"
|
|
213
|
+
resolved "https://registry.yarnpkg.com/promise/-/promise-8.3.0.tgz#8cb333d1edeb61ef23869fbb8a4ea0279ab60e0a"
|
|
214
|
+
integrity sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==
|
|
215
|
+
dependencies:
|
|
216
|
+
asap "~2.0.6"
|
|
217
|
+
|
|
218
|
+
resolve@^1.17.0:
|
|
219
|
+
version "1.22.1"
|
|
220
|
+
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177"
|
|
221
|
+
integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==
|
|
222
|
+
dependencies:
|
|
223
|
+
is-core-module "^2.9.0"
|
|
224
|
+
path-parse "^1.0.7"
|
|
225
|
+
supports-preserve-symlinks-flag "^1.0.0"
|
|
226
|
+
|
|
227
|
+
rollup@~2.27.0:
|
|
228
|
+
version "2.27.1"
|
|
229
|
+
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.27.1.tgz#372744e1d36eba0fd942d997600c2fc2ca266305"
|
|
230
|
+
integrity sha512-GiWHQvnmMgBktSpY/1+nrGpwPsTw4b9P28og2uedfeq4JZ16rzAmnQ5Pm/E0/BEmDNia1ZbY7+qu3nBgNa19Hg==
|
|
231
|
+
optionalDependencies:
|
|
232
|
+
fsevents "~2.1.2"
|
|
233
|
+
|
|
234
|
+
sourcemap-codec@^1.4.8:
|
|
235
|
+
version "1.4.8"
|
|
236
|
+
resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"
|
|
237
|
+
integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==
|
|
238
|
+
|
|
239
|
+
supports-preserve-symlinks-flag@^1.0.0:
|
|
240
|
+
version "1.0.0"
|
|
241
|
+
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
|
|
242
|
+
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
|
|
243
|
+
|
|
244
|
+
wrappy@1:
|
|
245
|
+
version "1.0.2"
|
|
246
|
+
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
|
247
|
+
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const path = require('path');
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The absolute path to the repo root.
|
|
15
|
+
*/
|
|
16
|
+
const REPO_ROOT /*: string */ = path.resolve(__dirname, '../../..');
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The absolute path to the android directory.
|
|
20
|
+
*/
|
|
21
|
+
const ANDROID_DIR /*: string */ = path.join(REPO_ROOT, 'android');
|
|
22
|
+
|
|
23
|
+
module.exports = {
|
|
24
|
+
REPO_ROOT,
|
|
25
|
+
ANDROID_DIR,
|
|
26
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
|
|
10
|
+
const { createHermesPrebuiltArtifactsTarball } = require("./hermes-utils");
|
|
11
|
+
const fs = require("fs");
|
|
12
|
+
const os = require("os");
|
|
13
|
+
const path = require("path");
|
|
14
|
+
/**
|
|
15
|
+
* This script creates a Hermes prebuilt artifacts tarball.
|
|
16
|
+
* Must be invoked after Hermes has been built.
|
|
17
|
+
*/
|
|
18
|
+
const yargs = require("yargs");
|
|
19
|
+
|
|
20
|
+
let argv = yargs
|
|
21
|
+
.option("i", {
|
|
22
|
+
alias: "inputDir",
|
|
23
|
+
describe: "Path to directory where Hermes build artifacts were generated.",
|
|
24
|
+
})
|
|
25
|
+
.option("b", {
|
|
26
|
+
alias: "buildType",
|
|
27
|
+
type: "string",
|
|
28
|
+
describe: "Specifies whether Hermes was built for Debug or Release.",
|
|
29
|
+
default: "Debug",
|
|
30
|
+
})
|
|
31
|
+
.option("o", {
|
|
32
|
+
alias: "outputDir",
|
|
33
|
+
describe: "Location where the tarball will be saved to.",
|
|
34
|
+
})
|
|
35
|
+
.option("exclude-debug-symbols", {
|
|
36
|
+
describe: "Whether dSYMs should be excluded from the tarball.",
|
|
37
|
+
type: "boolean",
|
|
38
|
+
default: true,
|
|
39
|
+
}).argv;
|
|
40
|
+
|
|
41
|
+
async function main() {
|
|
42
|
+
// $FlowFixMe[prop-missing]
|
|
43
|
+
const hermesDir = argv.inputDir;
|
|
44
|
+
// $FlowFixMe[prop-missing]
|
|
45
|
+
const buildType = argv.buildType;
|
|
46
|
+
// $FlowFixMe[prop-missing]
|
|
47
|
+
const excludeDebugSymbols = argv.excludeDebugSymbols;
|
|
48
|
+
// $FlowFixMe[prop-missing]
|
|
49
|
+
let tarballOutputDir = argv.outputDir;
|
|
50
|
+
|
|
51
|
+
if (!tarballOutputDir) {
|
|
52
|
+
try {
|
|
53
|
+
tarballOutputDir = fs.mkdtempSync(
|
|
54
|
+
path.join(os.tmpdir(), "hermes-engine-tarball-")
|
|
55
|
+
);
|
|
56
|
+
} catch (error) {
|
|
57
|
+
throw new Error(
|
|
58
|
+
`[Hermes] Failed to create temporary output directory: ${error}`
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const tarballOutputPath = createHermesPrebuiltArtifactsTarball(
|
|
64
|
+
hermesDir,
|
|
65
|
+
buildType,
|
|
66
|
+
tarballOutputDir,
|
|
67
|
+
excludeDebugSymbols
|
|
68
|
+
);
|
|
69
|
+
console.log(tarballOutputPath);
|
|
70
|
+
return tarballOutputPath;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
void main().then(() => {
|
|
74
|
+
process.exit(0);
|
|
75
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow
|
|
8
|
+
* @format
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/*::
|
|
12
|
+
import type {BuildType} from './version-utils';
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const {getVersion, validateBuildType} = require('./version-utils');
|
|
16
|
+
const {parseArgs} = require('util');
|
|
17
|
+
|
|
18
|
+
const config = {
|
|
19
|
+
options: {
|
|
20
|
+
'build-type': {
|
|
21
|
+
type: 'string',
|
|
22
|
+
short: 'b',
|
|
23
|
+
},
|
|
24
|
+
help: {type: 'boolean'},
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
async function main() {
|
|
29
|
+
const {
|
|
30
|
+
values: {'build-type': buildType, help},
|
|
31
|
+
/* $FlowFixMe[incompatible-call] Natural Inference rollout. See
|
|
32
|
+
* https://fburl.com/workplace/6291gfvu */
|
|
33
|
+
} = parseArgs(config);
|
|
34
|
+
|
|
35
|
+
if (help) {
|
|
36
|
+
console.log(`
|
|
37
|
+
Usage: node ./utils/scripts/hermes/get-hermes-version.js [OPTIONS]
|
|
38
|
+
|
|
39
|
+
Generates and outputs version string for the given build type.
|
|
40
|
+
|
|
41
|
+
Options:
|
|
42
|
+
--build-type One of ['dry-run', 'release'].
|
|
43
|
+
`);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (!validateBuildType(buildType)) {
|
|
48
|
+
throw new Error(`Unsupported build type: ${buildType}`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const version = await getVersion(buildType);
|
|
52
|
+
console.log(version);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (require.main === module) {
|
|
56
|
+
void main();
|
|
57
|
+
}
|