mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Compare commits
38 Commits
v17.0.0-ni
...
test-bake-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
855d43b6f8 | ||
|
|
6d7578e073 | ||
|
|
b5ab394d88 | ||
|
|
1615677ca1 | ||
|
|
dd357b92f5 | ||
|
|
054c11440e | ||
|
|
8e289b7c4d | ||
|
|
ccda7791fa | ||
|
|
71efde8535 | ||
|
|
b89b77b315 | ||
|
|
6074302214 | ||
|
|
f35f82b7cd | ||
|
|
5f37faec41 | ||
|
|
470587a2aa | ||
|
|
a41cd1df0b | ||
|
|
6f684d564f | ||
|
|
e07d74cf29 | ||
|
|
2c10d0fe1b | ||
|
|
1193a37d8f | ||
|
|
2d111a4e25 | ||
|
|
22d683e3f8 | ||
|
|
abf6f1cf78 | ||
|
|
4da66b9d68 | ||
|
|
02d3e66bcb | ||
|
|
3b155f7391 | ||
|
|
80577a4f08 | ||
|
|
a5f1fbdc54 | ||
|
|
ecf191e71f | ||
|
|
104e0f3059 | ||
|
|
10d92e9f29 | ||
|
|
a758a2eab3 | ||
|
|
0f6560f1f7 | ||
|
|
265474882c | ||
|
|
68c738a177 | ||
|
|
98ac0ca52a | ||
|
|
c377fe4ba6 | ||
|
|
25d0963d9b | ||
|
|
2360012cad |
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -8,9 +8,9 @@ body:
|
||||
label: Preflight Checklist
|
||||
description: Please ensure you've completed all of the following.
|
||||
options:
|
||||
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
|
||||
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
|
||||
required: true
|
||||
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
|
||||
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
|
||||
required: true
|
||||
- label: I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.
|
||||
required: true
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
4
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@@ -8,9 +8,9 @@ body:
|
||||
label: Preflight Checklist
|
||||
description: Please ensure you've completed all of the following.
|
||||
options:
|
||||
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
|
||||
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
|
||||
required: true
|
||||
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
|
||||
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
|
||||
required: true
|
||||
- label: I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.
|
||||
required: true
|
||||
|
||||
@@ -7,9 +7,9 @@ body:
|
||||
label: Preflight Checklist
|
||||
description: Please ensure you've completed all of the following.
|
||||
options:
|
||||
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
|
||||
- label: I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
|
||||
required: true
|
||||
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
|
||||
- label: I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
|
||||
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -3,7 +3,7 @@
|
||||
Thank you for your Pull Request. Please provide a description above and review
|
||||
the requirements below.
|
||||
|
||||
Contributors guide: https://github.com/electron/electron/blob/master/CONTRIBUTING.md
|
||||
Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.md
|
||||
-->
|
||||
|
||||
#### Checklist
|
||||
@@ -11,7 +11,7 @@ Contributors guide: https://github.com/electron/electron/blob/master/CONTRIBUTIN
|
||||
|
||||
- [ ] PR description included and stakeholders cc'd
|
||||
- [ ] `npm test` passes
|
||||
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/master/docs/development/testing.md)
|
||||
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
|
||||
- [ ] relevant documentation is changed or added
|
||||
- [ ] [PR release notes](https://github.com/electron/clerk/blob/master/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/master/README.md#examples).
|
||||
|
||||
|
||||
6
.github/config.yml
vendored
6
.github/config.yml
vendored
@@ -2,7 +2,7 @@
|
||||
newPRWelcomeComment: |
|
||||
💖 Thanks for opening this pull request! 💖
|
||||
|
||||
We use [semantic commit messages](https://github.com/electron/electron/blob/master/docs/development/pull-requests.md#commit-message-guidelines) to streamline the release process. Before your pull request can be merged, you should **update your pull request title** to start with a semantic prefix.
|
||||
We use [semantic commit messages](https://github.com/electron/electron/blob/main/docs/development/pull-requests.md#commit-message-guidelines) to streamline the release process. Before your pull request can be merged, you should **update your pull request title** to start with a semantic prefix.
|
||||
|
||||
Examples of commit messages with semantic prefixes:
|
||||
|
||||
@@ -12,9 +12,9 @@ newPRWelcomeComment: |
|
||||
|
||||
Things that will help get your PR across the finish line:
|
||||
|
||||
- Follow the JavaScript, C++, and Python [coding style](https://github.com/electron/electron/blob/master/docs/development/coding-style.md).
|
||||
- Follow the JavaScript, C++, and Python [coding style](https://github.com/electron/electron/blob/main/docs/development/coding-style.md).
|
||||
- Run `npm run lint` locally to catch formatting errors earlier.
|
||||
- Document any user-facing changes you've made following the [documentation styleguide](https://github.com/electron/electron/blob/master/docs/styleguide.md).
|
||||
- Document any user-facing changes you've made following the [documentation styleguide](https://github.com/electron/electron/blob/main/docs/styleguide.md).
|
||||
- Include tests when adding/changing behavior.
|
||||
- Include screenshots and animated GIFs whenever possible.
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ Having the original text _as well as_ the translation can help mitigate translat
|
||||
|
||||
Responses to posted issues may or may not be in the original language.
|
||||
|
||||
**Please note** that using non-English as an attempt to circumvent our [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) will be an immediate, and possibly indefinite, ban from the project.
|
||||
**Please note** that using non-English as an attempt to circumvent our [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) will be an immediate, and possibly indefinite, ban from the project.
|
||||
|
||||
## [Pull Requests](https://electronjs.org/docs/development/pull-requests)
|
||||
|
||||
|
||||
2
DEPS
2
DEPS
@@ -17,7 +17,7 @@ vars = {
|
||||
'chromium_version':
|
||||
'95.0.4629.0',
|
||||
'node_version':
|
||||
'v16.9.1',
|
||||
'v16.10.0',
|
||||
'nan_version':
|
||||
# The following commit hash of NAN is v2.14.2 with *only* changes to the
|
||||
# test suite. This should be updated to a specific tag when one becomes
|
||||
|
||||
@@ -1 +1 @@
|
||||
17.0.0-nightly.20210924
|
||||
17.0.0-nightly.20210930
|
||||
@@ -1,7 +1,7 @@
|
||||
[](https://electronjs.org)
|
||||
|
||||
[](https://circleci.com/gh/electron/electron/tree/master)
|
||||
[](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/master)
|
||||
[](https://circleci.com/gh/electron/electron/tree/main)
|
||||
[](https://ci.appveyor.com/project/electron-bot/electron-ljo26/branch/main)
|
||||
[](https://discord.com/invite/electron)
|
||||
|
||||
:memo: Available Translations: 🇨🇳 🇧🇷 🇪🇸 🇯🇵 🇷🇺 🇫🇷 🇺🇸 🇩🇪.
|
||||
@@ -16,7 +16,7 @@ Follow [@ElectronJS](https://twitter.com/electronjs) on Twitter for important
|
||||
announcements.
|
||||
|
||||
This project adheres to the Contributor Covenant
|
||||
[code of conduct](https://github.com/electron/electron/tree/master/CODE_OF_CONDUCT.md).
|
||||
[code of conduct](https://github.com/electron/electron/tree/main/CODE_OF_CONDUCT.md).
|
||||
By participating, you are expected to uphold this code. Please report unacceptable
|
||||
behavior to [coc@electronjs.org](mailto:coc@electronjs.org).
|
||||
|
||||
@@ -97,6 +97,6 @@ and more can be found in the [support document](docs/tutorial/support.md#finding
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/electron/electron/blob/master/LICENSE)
|
||||
[MIT](https://github.com/electron/electron/blob/main/LICENSE)
|
||||
|
||||
When using the Electron or other GitHub logos, be sure to follow the [GitHub logo guidelines](https://github.com/logos).
|
||||
|
||||
@@ -10,7 +10,7 @@ Report security bugs in third-party modules to the person or team maintaining th
|
||||
|
||||
## The Electron Security Notification Process
|
||||
|
||||
For context on Electron's security notification process, please see the [Notifications](https://github.com/electron/governance/blob/master/wg-security/membership-and-notifications.md#notifications) section of the Security WG's [Membership and Notifications](https://github.com/electron/governance/blob/master/wg-security/membership-and-notifications.md) Governance document.
|
||||
For context on Electron's security notification process, please see the [Notifications](https://github.com/electron/governance/blob/main/wg-security/membership-and-notifications.md#notifications) section of the Security WG's [Membership and Notifications](https://github.com/electron/governance/blob/main/wg-security/membership-and-notifications.md) Governance document.
|
||||
|
||||
## Learning More About Security
|
||||
|
||||
|
||||
80
appveyor-bake.yml
Normal file
80
appveyor-bake.yml
Normal file
@@ -0,0 +1,80 @@
|
||||
# The config expects the following environment variables to be set:
|
||||
# - "GN_CONFIG" Build type. One of {'testing', 'release'}.
|
||||
# - "GN_EXTRA_ARGS" Additional gn arguments for a build config,
|
||||
# e.g. 'target_cpu="x86"' to build for a 32bit platform.
|
||||
# https://gn.googlesource.com/gn/+/master/docs/reference.md#target_cpu
|
||||
# Don't forget to set up "NPM_CONFIG_ARCH" and "TARGET_ARCH" accordningly
|
||||
# if you pass a custom value for 'target_cpu'.
|
||||
# - "ELECTRON_RELEASE" Set it to '1' upload binaries on success.
|
||||
# - "NPM_CONFIG_ARCH" E.g. 'x86'. Is used to build native Node.js modules.
|
||||
# Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "TARGET_ARCH" value.
|
||||
# - "TARGET_ARCH" Choose from {'ia32', 'x64', 'arm', 'arm64', 'mips64el'}.
|
||||
# Is used in some publishing scripts, but does NOT affect the Electron binary.
|
||||
# Must match 'target_cpu' passed to "GN_EXTRA_ARGS" and "NPM_CONFIG_ARCH" value.
|
||||
# - "UPLOAD_TO_S3" Set it to '1' upload a release to the S3 bucket.
|
||||
# Otherwise the release will be uploaded to the Github Releases.
|
||||
# (The value is only checked if "ELECTRON_RELEASE" is defined.)
|
||||
#
|
||||
# The publishing scripts expect access tokens to be defined as env vars,
|
||||
# but those are not covered here.
|
||||
#
|
||||
# AppVeyor docs on variables:
|
||||
# https://www.appveyor.com/docs/environment-variables/
|
||||
# https://www.appveyor.com/docs/build-configuration/#secure-variables
|
||||
# https://www.appveyor.com/docs/build-configuration/#custom-environment-variables
|
||||
|
||||
# Uncomment these lines to enable RDP
|
||||
#on_finish:
|
||||
# - ps: >-
|
||||
# if ($env:TARGET_ARCH -eq 'x64') {
|
||||
# echo "SETTING BAKE IMAGE"
|
||||
# $env:APPVEYOR_RDP_PASSWORD = "electron"
|
||||
# $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
# }
|
||||
version: 1.0.{build}
|
||||
build_cloud: electron-16-core2
|
||||
image: base-electron
|
||||
environment:
|
||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
||||
ELECTRON_OUT_DIR: Default
|
||||
ELECTRON_ENABLE_STACK_DUMPING: 1
|
||||
MOCHA_REPORTER: mocha-multi-reporters
|
||||
MOCHA_MULTI_REPORTERS: mocha-appveyor-reporter, tap
|
||||
GOMA_FALLBACK_ON_AUTH_FAILURE: true
|
||||
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
|
||||
PYTHONIOENCODING: UTF-8
|
||||
build_script:
|
||||
- echo "Building $env:GN_CONFIG build"
|
||||
- git config --global core.longpaths true
|
||||
- cd ..
|
||||
- mkdir src
|
||||
- ps: git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
|
||||
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
|
||||
- src\electron\script\setup-win-for-dev.bat
|
||||
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
|
||||
- ps: >-
|
||||
if ($env:GN_CONFIG -ne 'release') {
|
||||
$env:NINJA_STATUS="[%r processes, %f/%t @ %o/s : %es] "
|
||||
}
|
||||
- >-
|
||||
gclient config
|
||||
--name "src\electron"
|
||||
--unmanaged
|
||||
%GCLIENT_EXTRA_ARGS%
|
||||
"https://github.com/electron/electron"
|
||||
- gclient sync --with_branch_heads --with_tags
|
||||
after_build:
|
||||
- ps: |
|
||||
if ($env:TARGET_ARCH -eq 'x64') {
|
||||
echo "SETTING BAKE IMAGE"
|
||||
$env:APPVEYOR_BAKE_IMAGE = 'electron-test-bake-image-jk'
|
||||
} else {
|
||||
echo "SKIPPING BAKE IMAGE for $env:TARGET_ARCH"
|
||||
}
|
||||
|
||||
on_image_bake:
|
||||
- ps: >-
|
||||
echo "Baking image: $env:APPVEYOR_BAKE_IMAGE at dir $PWD"
|
||||
Remove-Item $pwd\depot_tools
|
||||
Remove-Item $pwd\src\electron
|
||||
106
appveyor.yml
106
appveyor.yml
@@ -24,47 +24,31 @@
|
||||
# https://www.appveyor.com/docs/build-configuration/#custom-environment-variables
|
||||
|
||||
# Uncomment these lines to enable RDP
|
||||
#on_finish:
|
||||
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
|
||||
on_finish:
|
||||
- ps: >-
|
||||
if ($env:TARGET_ARCH -eq 'x64') {
|
||||
echo "SETTING BAKE IMAGE"
|
||||
$env:APPVEYOR_RDP_PASSWORD = "electron"
|
||||
$blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
}
|
||||
version: 1.0.{build}
|
||||
build_cloud: electron-16-core
|
||||
image: vs2019bt-16.6.2
|
||||
build_cloud: electron-16-core2
|
||||
image: electron-test-bake-image
|
||||
environment:
|
||||
GIT_CACHE_PATH: C:\Users\electron\libcc_cache
|
||||
GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
|
||||
ELECTRON_OUT_DIR: Default
|
||||
ELECTRON_ENABLE_STACK_DUMPING: 1
|
||||
MOCHA_REPORTER: mocha-multi-reporters
|
||||
MOCHA_MULTI_REPORTERS: mocha-appveyor-reporter, tap
|
||||
GOMA_FALLBACK_ON_AUTH_FAILURE: true
|
||||
notifications:
|
||||
- provider: Webhook
|
||||
url: https://electron-mission-control.herokuapp.com/rest/appveyor-hook
|
||||
method: POST
|
||||
headers:
|
||||
x-mission-control-secret:
|
||||
secure: 90BLVPcqhJPG7d24v0q/RRray6W3wDQ8uVQlQjOHaBWkw1i8FoA1lsjr2C/v1dVok+tS2Pi6KxDctPUkwIb4T27u4RhvmcPzQhVpfwVJAG9oNtq+yKN7vzHfg7k/pojEzVdJpQLzeJGcSrZu7VY39Q==
|
||||
on_build_success: false
|
||||
on_build_failure: true
|
||||
on_build_status_changed: false
|
||||
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
|
||||
PYTHONIOENCODING: UTF-8
|
||||
build_script:
|
||||
- ps: >-
|
||||
if(($env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME -split "/")[0] -eq ($env:APPVEYOR_REPO_NAME -split "/")[0]) {
|
||||
Write-warning "Skipping PR build for branch"; Exit-AppveyorBuild
|
||||
} else {
|
||||
node script/yarn.js install --frozen-lockfile
|
||||
|
||||
$result = node script/doc-only-change.js --prNumber=$env:APPVEYOR_PULL_REQUEST_NUMBER --prBranch=$env:APPVEYOR_REPO_BRANCH
|
||||
Write-Output $result
|
||||
if ($result.ExitCode -eq 0) {
|
||||
Write-warning "Skipping build for doc only change"; Exit-AppveyorBuild
|
||||
}
|
||||
}
|
||||
- echo "Building $env:GN_CONFIG build"
|
||||
- git config --global core.longpaths true
|
||||
- cd ..
|
||||
- mkdir src
|
||||
- update_depot_tools.bat
|
||||
# - ps: git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
||||
- ps: $env:PATH="$pwd\depot_tools;$env:PATH"
|
||||
- ps: Move-Item $env:APPVEYOR_BUILD_FOLDER -Destination src\electron
|
||||
- ps: $env:CHROMIUM_BUILDTOOLS_PATH="$pwd\src\buildtools"
|
||||
- ps: >-
|
||||
@@ -77,58 +61,7 @@ build_script:
|
||||
--unmanaged
|
||||
%GCLIENT_EXTRA_ARGS%
|
||||
"https://github.com/electron/electron"
|
||||
- ps: >-
|
||||
if ($env:GN_CONFIG -eq 'release') {
|
||||
$env:RUN_GCLIENT_SYNC="true"
|
||||
} else {
|
||||
cd src\electron
|
||||
node script\generate-deps-hash.js
|
||||
$depshash = Get-Content .\.depshash -Raw
|
||||
$zipfile = "Z:\$depshash.7z"
|
||||
cd ..\..
|
||||
if (Test-Path -Path $zipfile) {
|
||||
# file exists, unzip and then gclient sync
|
||||
7z x -y $zipfile -mmt=30 -aoa
|
||||
if (-not (Test-Path -Path "src\buildtools")) {
|
||||
# the zip file must be corrupt - resync
|
||||
$env:RUN_GCLIENT_SYNC="true"
|
||||
if ($env:TARGET_ARCH -ne 'ia32') {
|
||||
# only save on x64/woa to avoid contention saving
|
||||
$env:SAVE_GCLIENT_SRC="true"
|
||||
}
|
||||
} else {
|
||||
# update angle
|
||||
cd src\third_party\angle
|
||||
git remote set-url origin https://chromium.googlesource.com/angle/angle.git
|
||||
git fetch
|
||||
cd ..\..\..
|
||||
}
|
||||
} else {
|
||||
# file does not exist, gclient sync, then zip
|
||||
$env:RUN_GCLIENT_SYNC="true"
|
||||
if ($env:TARGET_ARCH -ne 'ia32') {
|
||||
# only save on x64/woa to avoid contention saving
|
||||
$env:SAVE_GCLIENT_SRC="true"
|
||||
}
|
||||
}
|
||||
}
|
||||
- if "%RUN_GCLIENT_SYNC%"=="true" ( gclient sync )
|
||||
- ps: >-
|
||||
if ($env:SAVE_GCLIENT_SRC -eq 'true') {
|
||||
# archive current source for future use
|
||||
# only run on x64/woa to avoid contention saving
|
||||
$(7z a $zipfile src -xr!android_webview -xr!electron -xr'!*\.git' -xr!third_party\WebKit\LayoutTests! -xr!third_party\blink\web_tests -xr!third_party\blink\perf_tests -slp -t7z -mmt=30)
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-warning "Could not save source to shared drive; continuing anyway"
|
||||
}
|
||||
# build time generation of file gen/angle/angle_commit.h depends on
|
||||
# third_party/angle/.git
|
||||
# https://chromium-review.googlesource.com/c/angle/angle/+/2074924
|
||||
$(7z a $zipfile src\third_party\angle\.git)
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-warning "Failed to add third_party\angle\.git; continuing anyway"
|
||||
}
|
||||
}
|
||||
- gclient sync --with_branch_heads --with_tags
|
||||
- ps: >-
|
||||
if (Test-Path 'env:RAW_GOMA_AUTH') {
|
||||
$env:GOMA_OAUTH2_CONFIG_FILE = "$pwd\.goma_oauth2_config"
|
||||
@@ -142,9 +75,8 @@ build_script:
|
||||
node -e "require('./src/utils/goma.js').downloadAndPrepare({ gomaOneForAll: true })"
|
||||
- ps: $env:GN_GOMA_FILE = node -e "console.log(require('./src/utils/goma.js').gnFilePath)"
|
||||
- ps: $env:LOCAL_GOMA_DIR = node -e "console.log(require('./src/utils/goma.js').dir)"
|
||||
- cd ..
|
||||
- ps: .\src\electron\script\start-goma.ps1 -gomaDir $env:LOCAL_GOMA_DIR
|
||||
- cd src
|
||||
- ps: node -e "console.log(require('./src/utils/goma.js').ensure())"
|
||||
- cd ..\src
|
||||
- set BUILD_CONFIG_PATH=//electron/build/args/%GN_CONFIG%.gn
|
||||
- gn gen out/Default "--args=import(\"%BUILD_CONFIG_PATH%\") import(\"%GN_GOMA_FILE%\") %GN_EXTRA_ARGS% "
|
||||
- gn check out/Default //electron:electron_lib
|
||||
@@ -205,7 +137,7 @@ test_script:
|
||||
New-Item .\out\Default\gen\node_headers\Release -Type directory
|
||||
Copy-Item -path .\out\Default\electron.lib -destination .\out\Default\gen\node_headers\Release\node.lib
|
||||
} else {
|
||||
echo "Skipping tests for $env:GN_CONFIG build"
|
||||
Write-Host "Skipping tests for $env:GN_CONFIG build"
|
||||
}
|
||||
- cd electron
|
||||
# CalculateNativeWinOcclusion is disabled due to https://bugs.chromium.org/p/chromium/issues/detail?id=1139022
|
||||
@@ -230,4 +162,4 @@ deploy_script:
|
||||
}
|
||||
} elseif (Test-Path Env:\TEST_WOA) {
|
||||
node script/release/ci-release-build.js --job=electron-woa-testing --ci=VSTS --armTest --appveyorJobId=$env:APPVEYOR_JOB_ID $env:APPVEYOR_REPO_BRANCH
|
||||
}
|
||||
}
|
||||
@@ -632,7 +632,7 @@ error.
|
||||
### API Changed: `shell.openItem` is now `shell.openPath`
|
||||
|
||||
The `shell.openItem` API has been replaced with an asynchronous `shell.openPath` API.
|
||||
You can see the original API proposal and reasoning [here](https://github.com/electron/governance/blob/master/wg-api/spec-documents/shell-openitem.md).
|
||||
You can see the original API proposal and reasoning [here](https://github.com/electron/governance/blob/main/wg-api/spec-documents/shell-openitem.md).
|
||||
|
||||
## Planned Breaking API Changes (8.0)
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ These guides are intended for people working on the Electron project itself.
|
||||
For guides on Electron app development, see
|
||||
[/docs/README.md](../README.md#guides-and-tutorials).
|
||||
|
||||
* [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md)
|
||||
* [Contributing to Electron](https://github.com/electron/electron/blob/master/CONTRIBUTING.md)
|
||||
* [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md)
|
||||
* [Contributing to Electron](https://github.com/electron/electron/blob/main/CONTRIBUTING.md)
|
||||
* [Issues](issues.md)
|
||||
* [Pull Requests](pull-requests.md)
|
||||
* [Documentation Styleguide](coding-style.md#documentation)
|
||||
|
||||
@@ -8,7 +8,7 @@ Example Use Case:
|
||||
* We need `VS15.9` and we have `VS15.7` installed; this would require us to update an Azure image.
|
||||
|
||||
1. Identify the image you wish to modify.
|
||||
* In [appveyor.yml](https://github.com/electron/electron/blob/master/appveyor.yml), the image is identified by the property *image*.
|
||||
* In [appveyor.yml](https://github.com/electron/electron/blob/main/appveyor.yml), the image is identified by the property *image*.
|
||||
* The names used correspond to the *"images"* defined for a build cloud, eg the [libcc-20 cloud](https://windows-ci.electronjs.org/build-clouds/8).
|
||||
* Find the image you wish to modify in the build cloud and make note of the **VHD Blob Path** for that image, which is the value for that corresponding key.
|
||||
* You will need this URI path to copy into a new image.
|
||||
|
||||
@@ -65,8 +65,8 @@ origin URLs.
|
||||
$ cd src/electron
|
||||
$ git remote remove origin
|
||||
$ git remote add origin https://github.com/electron/electron
|
||||
$ git checkout master
|
||||
$ git branch --set-upstream-to=origin/master
|
||||
$ git checkout main
|
||||
$ git branch --set-upstream-to=origin/main
|
||||
$ cd -
|
||||
```
|
||||
|
||||
|
||||
@@ -26,7 +26,9 @@ you prefer a graphical interface.
|
||||
* **.lldbinit**: Create or edit `~/.lldbinit` to allow Chromium code to be properly source-mapped.
|
||||
|
||||
```text
|
||||
command script import ~/electron/src/tools/lldb/lldbinit.py
|
||||
# e.g: ['~/electron/src/tools/lldb']
|
||||
script sys.path[:0] = ['<...path/to/electron/src/tools/lldb>']
|
||||
script import lldbinit
|
||||
```
|
||||
|
||||
## Attaching to and Debugging Electron
|
||||
|
||||
@@ -72,4 +72,4 @@ to try NW.js.
|
||||
|
||||
[nwjs]: https://nwjs.io/
|
||||
[electron-modules]: https://www.npmjs.com/search?q=electron
|
||||
[node-bindings]: https://github.com/electron/electron/tree/master/lib/common
|
||||
[node-bindings]: https://github.com/electron/electron/tree/main/lib/common
|
||||
|
||||
@@ -45,10 +45,10 @@ Once you've built the project locally, you're ready to start making changes!
|
||||
### Step 3: Branch
|
||||
|
||||
To keep your development environment organized, create local branches to
|
||||
hold your work. These should be branched directly off of the `master` branch.
|
||||
hold your work. These should be branched directly off of the `main` branch.
|
||||
|
||||
```sh
|
||||
$ git checkout -b my-branch -t upstream/master
|
||||
$ git checkout -b my-branch -t upstream/main
|
||||
```
|
||||
|
||||
## Making Changes
|
||||
@@ -134,11 +134,11 @@ Once you have committed your changes, it is a good idea to use `git rebase`
|
||||
|
||||
```sh
|
||||
$ git fetch upstream
|
||||
$ git rebase upstream/master
|
||||
$ git rebase upstream/main
|
||||
```
|
||||
|
||||
This ensures that your working branch has the latest changes from `electron/electron`
|
||||
master.
|
||||
main.
|
||||
|
||||
### Step 7: Test
|
||||
|
||||
@@ -189,7 +189,7 @@ the requirements below.
|
||||
|
||||
Bug fixes and new features should include tests and possibly benchmarks.
|
||||
|
||||
Contributors guide: https://github.com/electron/electron/blob/master/CONTRIBUTING.md
|
||||
Contributors guide: https://github.com/electron/electron/blob/main/CONTRIBUTING.md
|
||||
-->
|
||||
```
|
||||
|
||||
@@ -222,7 +222,7 @@ seem unfamiliar, refer to this
|
||||
#### Approval and Request Changes Workflow
|
||||
|
||||
All pull requests require approval from a
|
||||
[Code Owner](https://github.com/electron/electron/blob/master/.github/CODEOWNERS)
|
||||
[Code Owner](https://github.com/electron/electron/blob/main/.github/CODEOWNERS)
|
||||
of the area you modified in order to land. Whenever a maintainer reviews a pull
|
||||
request they may request changes. These may be small, such as fixing a typo, or
|
||||
may involve substantive changes. Such requests are intended to be helpful, but
|
||||
|
||||
@@ -51,4 +51,4 @@ Somewhere in the Electron binary there will be a sequence of bytes that look lik
|
||||
|
||||
To flip a fuse you find its position in the fuse wire and change it to "0" or "1" depending on the state you'd like.
|
||||
|
||||
You can view the current schema [here](https://github.com/electron/electron/blob/master/build/fuses/fuses.json5).
|
||||
You can view the current schema [here](https://github.com/electron/electron/blob/main/build/fuses/fuses.json5).
|
||||
|
||||
@@ -23,7 +23,7 @@ your responsibility to ensure that the code is not malicious.
|
||||
## Reporting Security Issues
|
||||
|
||||
For information on how to properly disclose an Electron vulnerability,
|
||||
see [SECURITY.md](https://github.com/electron/electron/tree/master/SECURITY.md)
|
||||
see [SECURITY.md](https://github.com/electron/electron/tree/main/SECURITY.md)
|
||||
|
||||
## Chromium Security Issues and Upgrades
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## Finding Support
|
||||
|
||||
If you have a security concern,
|
||||
please see the [security document](https://github.com/electron/electron/tree/master/SECURITY.md).
|
||||
please see the [security document](https://github.com/electron/electron/tree/main/SECURITY.md).
|
||||
|
||||
If you're looking for programming help,
|
||||
for answers to questions,
|
||||
@@ -26,7 +26,7 @@ you can interact with the community in these locations:
|
||||
* [`electron-pl`](https://electronpl.github.io) *(Poland)*
|
||||
|
||||
If you'd like to contribute to Electron,
|
||||
see the [contributing document](https://github.com/electron/electron/blob/master/CONTRIBUTING.md).
|
||||
see the [contributing document](https://github.com/electron/electron/blob/main/CONTRIBUTING.md).
|
||||
|
||||
If you've found a bug in a [supported version](#supported-versions) of Electron,
|
||||
please report it with the [issue tracker](../development/issues.md).
|
||||
@@ -50,15 +50,15 @@ as the 4.2.x series are supported. We only support the latest minor release
|
||||
for each stable release series. This means that in the case of a security fix
|
||||
6.1.x will receive the fix, but we will not release a new version of 6.0.x.
|
||||
|
||||
The latest stable release unilaterally receives all fixes from `master`,
|
||||
The latest stable release unilaterally receives all fixes from `main`,
|
||||
and the version prior to that receives the vast majority of those fixes
|
||||
as time and bandwidth warrants. The oldest supported release line will receive
|
||||
only security fixes directly.
|
||||
|
||||
All supported release lines will accept external pull requests to backport
|
||||
fixes previously merged to `master`, though this may be on a case-by-case
|
||||
fixes previously merged to `main`, though this may be on a case-by-case
|
||||
basis for some older supported lines. All contested decisions around release
|
||||
line backports will be resolved by the [Releases Working Group](https://github.com/electron/governance/tree/master/wg-releases) as an agenda item at their weekly meeting the week the backport PR is raised.
|
||||
line backports will be resolved by the [Releases Working Group](https://github.com/electron/governance/tree/main/wg-releases) as an agenda item at their weekly meeting the week the backport PR is raised.
|
||||
|
||||
When an API is changed or removed in a way that breaks existing functionality, the
|
||||
previous functionality will be supported for a minimum of two major versions when
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "electron",
|
||||
"version": "17.0.0-nightly.20210924",
|
||||
"version": "17.0.0-nightly.20210930",
|
||||
"repository": "https://github.com/electron/electron",
|
||||
"description": "Build cross platform desktop apps with JavaScript, HTML, and CSS",
|
||||
"devDependencies": {
|
||||
|
||||
@@ -24,4 +24,4 @@ fix_account_for_debugger_agent_race_condition.patch
|
||||
add_should_read_node_options_from_env_option_to_disable_node_options.patch
|
||||
repl_fix_crash_when_sharedarraybuffer_disabled.patch
|
||||
fix_readbarrier_undefined_symbol_error_on_woa_arm64.patch
|
||||
fix_-wunreachable-code-return.patch
|
||||
fix_crash_creating_private_key_with_unsupported_algorithm.patch
|
||||
|
||||
@@ -21,7 +21,7 @@ index 1cc7da1ce15f43905ce607adcc1a23ed9d92948a..16af6aec3791df1363682f1ed024c522
|
||||
Isolate* isolate,
|
||||
const std::vector<std::string>& args,
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index b38a69fc06a189569524df767dbbbe5c1985aa20..6b22cc4aaaf59d309d1bcebfbb3710ceeafd13e6 100644
|
||||
index d31512ae37fba212a20cf306be46f7dfadeabd6a..8286ea06cc5c4e836921b06b37cf19d4508f4832 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -1145,6 +1145,8 @@ class Environment : public MemoryRetainer {
|
||||
@@ -34,7 +34,7 @@ index b38a69fc06a189569524df767dbbbe5c1985aa20..6b22cc4aaaf59d309d1bcebfbb3710ce
|
||||
inline std::vector<double>* destroy_async_id_list();
|
||||
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index 6302bb925339d709a54151a8fc8b58f1a2253881..48a9eedfaf6350fc05fb104a1f44e85b75878f9a 100644
|
||||
index 788e61645a281197cb3a1f3acbae427ddae1ab23..5afd3541d52d275d55067ddb1c11a585214eff41 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -882,7 +882,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
|
||||
@@ -47,10 +47,10 @@ index 6302bb925339d709a54151a8fc8b58f1a2253881..48a9eedfaf6350fc05fb104a1f44e85b
|
||||
ParseNodeOptionsEnvVar(node_options, errors);
|
||||
|
||||
diff --git a/src/node_worker.cc b/src/node_worker.cc
|
||||
index 3e3cb67d9e8c8b1ea867ff31d96a81709b47cc8d..679282e688258314fcd594bab7fd711cac2c9e48 100644
|
||||
index 16b7be36f284311f38583fa1df28a2945560b524..62a7dae080fad7e18863968dee22dbe4b461ab82 100644
|
||||
--- a/src/node_worker.cc
|
||||
+++ b/src/node_worker.cc
|
||||
@@ -457,6 +457,7 @@ void Worker::New(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -467,6 +467,7 @@ void Worker::New(const FunctionCallbackInfo<Value>& args) {
|
||||
});
|
||||
|
||||
#ifndef NODE_WITHOUT_NODE_OPTIONS
|
||||
@@ -58,7 +58,7 @@ index 3e3cb67d9e8c8b1ea867ff31d96a81709b47cc8d..679282e688258314fcd594bab7fd711c
|
||||
MaybeLocal<String> maybe_node_opts =
|
||||
env_vars->Get(isolate, OneByteString(isolate, "NODE_OPTIONS"));
|
||||
Local<String> node_opts;
|
||||
@@ -487,6 +488,7 @@ void Worker::New(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -497,6 +498,7 @@ void Worker::New(const FunctionCallbackInfo<Value>& args) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1781,7 +1781,7 @@ index 0000000000000000000000000000000000000000..d1d6b51e8c0c5bc6a5d09e217eb30483
|
||||
+ args = rebase_path(inputs + outputs, root_build_dir)
|
||||
+}
|
||||
diff --git a/src/node_version.h b/src/node_version.h
|
||||
index 48b8d9f22fb98d0733630eaea3194d746fba8a2f..a7a12564e4dd9320959d07fb4ab1527f942cf115 100644
|
||||
index a572d9b95853730a29a67349b46d47d6180586f3..888a95f93411a9168b75751e0af12c74fc5f0ba9 100644
|
||||
--- a/src/node_version.h
|
||||
+++ b/src/node_version.h
|
||||
@@ -89,7 +89,10 @@
|
||||
|
||||
@@ -8,7 +8,7 @@ modules from being used in the renderer process. This should be upstreamed as
|
||||
a customizable error message.
|
||||
|
||||
diff --git a/src/node_binding.cc b/src/node_binding.cc
|
||||
index 8b8389ae53608afedc9cc0ad2a6c8461b7aa893e..e79ddab7d73c6297ef1dc74b2a0ce469bf49e37c 100644
|
||||
index e323f76261f2028ef58da74066f9112d8a5a8df2..02d8566caffb86d05645fb602ca7b5c6b8c71aa9 100644
|
||||
--- a/src/node_binding.cc
|
||||
+++ b/src/node_binding.cc
|
||||
@@ -4,6 +4,7 @@
|
||||
@@ -19,7 +19,7 @@ index 8b8389ae53608afedc9cc0ad2a6c8461b7aa893e..e79ddab7d73c6297ef1dc74b2a0ce469
|
||||
#include "util.h"
|
||||
|
||||
#include <string>
|
||||
@@ -466,7 +467,12 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -472,7 +473,12 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
|
||||
if (mp->nm_context_register_func == nullptr) {
|
||||
if (env->force_context_aware()) {
|
||||
dlib->Close();
|
||||
|
||||
@@ -8,10 +8,10 @@ they use themselves as the entry point. We should try to upstream some form
|
||||
of this.
|
||||
|
||||
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
|
||||
index 076eb528af016b9143985685bc6d1e7c14fa80e6..40370102a2f0b6e692761626653c232a77810fbc 100644
|
||||
index 9d2799c3c9ac3b216c2289ae4e037dd228844d23..5b31df1207d4417a6f9b784574e3779650ba21d2 100644
|
||||
--- a/lib/internal/bootstrap/pre_execution.js
|
||||
+++ b/lib/internal/bootstrap/pre_execution.js
|
||||
@@ -104,10 +104,12 @@ function patchProcessObject(expandArgv1) {
|
||||
@@ -105,10 +105,12 @@ function patchProcessObject(expandArgv1) {
|
||||
if (expandArgv1 && process.argv[1] &&
|
||||
!StringPrototypeStartsWith(process.argv[1], '-')) {
|
||||
// Expand process.argv[1] into a full path.
|
||||
|
||||
@@ -8,7 +8,7 @@ node modules will have different (wrong) ideas about how v8 structs are laid
|
||||
out in memory on 64-bit machines, and will summarily fail to work.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 75fc36bc3c0eee65a6bb00ec31c79aabf3bb7dde..82722da38f0027626e204dd7a33f7bc5e070059d 100644
|
||||
index c222ed20be858544d454c59192889132eaa9e1ee..4f352dea639cc9ab8913b915d35df4edf4fb6a06 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
@@ -9,10 +9,10 @@ modules to sandboxed renderers.
|
||||
TODO(codebytere): remove and replace with a public facing API.
|
||||
|
||||
diff --git a/src/node_binding.cc b/src/node_binding.cc
|
||||
index 3c9776e655d0e458cdd3ab7c3adafff7de339cc5..8b8389ae53608afedc9cc0ad2a6c8461b7aa893e 100644
|
||||
index 050c5dff0ad5fc0692e348741b820762d40bd498..e323f76261f2028ef58da74066f9112d8a5a8df2 100644
|
||||
--- a/src/node_binding.cc
|
||||
+++ b/src/node_binding.cc
|
||||
@@ -608,6 +608,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
|
||||
@@ -614,6 +614,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
|
||||
args.GetReturnValue().Set(exports);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ Environment on the V8 context of blink, so no new V8 context is created.
|
||||
As a result, a renderer process may have multiple Node Environments in it.
|
||||
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index 3ee25ebbd67a01d607456e5158c98ca2fdea396b..6302bb925339d709a54151a8fc8b58f1a2253881 100644
|
||||
index acf4f0fac03c0ba655d55bc832a37a816ac26a33..788e61645a281197cb3a1f3acbae427ddae1ab23 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -139,6 +139,8 @@ using v8::Undefined;
|
||||
@@ -67,7 +67,7 @@ index 3ee25ebbd67a01d607456e5158c98ca2fdea396b..6302bb925339d709a54151a8fc8b58f1
|
||||
std::string tz;
|
||||
if (credentials::SafeGetenv("TZ", &tz) && !tz.empty()) {
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 049163bf27cc7c1d6433b65becab0d7761491f09..09cb7a317cc46e88e5d214996dc87dc6e8730b1a 100644
|
||||
index 1f9afa558d0c8b7950a0f5862017e09a08118ec1..45de72bd94cf669ac2badf89d23164cb7022a5b3 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -213,6 +213,8 @@ namespace node {
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: feat: initialize asar support
|
||||
This patch initializes asar support in Node.js.
|
||||
|
||||
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js
|
||||
index 0906b35edc5ff38fb7730eba9cebcc0e472fe56c..076eb528af016b9143985685bc6d1e7c14fa80e6 100644
|
||||
index a4c73cba5481b3005474742483a554c93358c4e1..9d2799c3c9ac3b216c2289ae4e037dd228844d23 100644
|
||||
--- a/lib/internal/bootstrap/pre_execution.js
|
||||
+++ b/lib/internal/bootstrap/pre_execution.js
|
||||
@@ -76,6 +76,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
|
||||
@@ -77,6 +77,7 @@ function prepareMainThreadExecution(expandArgv1 = false) {
|
||||
assert(!CJSLoader.hasLoadedAnyUserCJSModule);
|
||||
loadPreloadModules();
|
||||
initializeFrozenIntrinsics();
|
||||
@@ -17,7 +17,7 @@ index 0906b35edc5ff38fb7730eba9cebcc0e472fe56c..076eb528af016b9143985685bc6d1e7c
|
||||
}
|
||||
|
||||
function patchProcessObject(expandArgv1) {
|
||||
@@ -482,6 +483,10 @@ function loadPreloadModules() {
|
||||
@@ -485,6 +486,10 @@ function loadPreloadModules() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: deepak1556 <hop2deep@gmail.com>
|
||||
Date: Fri, 20 Aug 2021 22:41:11 -0700
|
||||
Subject: fix: -Wunreachable-code-return
|
||||
|
||||
Should be upstreamed.
|
||||
|
||||
Upstreamed in https://github.com/nodejs/node/pull/40034.
|
||||
|
||||
diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc
|
||||
index 612ce2b78b41badccbbce0616dffd86de042738f..c4a3322c6d972fc2052af75b79389c522924d9c5 100644
|
||||
--- a/src/inspector_agent.cc
|
||||
+++ b/src/inspector_agent.cc
|
||||
@@ -87,7 +87,6 @@ inline void* StartIoThreadMain(void* unused) {
|
||||
if (agent != nullptr)
|
||||
agent->RequestIoThreadStart();
|
||||
}
|
||||
- return nullptr;
|
||||
}
|
||||
|
||||
static int StartDebugSignalHandler() {
|
||||
diff --git a/src/node_url.cc b/src/node_url.cc
|
||||
index d7549e3bc05562d67bdef5aebf1fefa550b72eb6..d78cb7a3e1ceb075bd532e823a915b18f5a52afd 100644
|
||||
--- a/src/node_url.cc
|
||||
+++ b/src/node_url.cc
|
||||
@@ -600,7 +600,6 @@ std::string URLHost::ToString() const {
|
||||
case HostType::H_DOMAIN:
|
||||
case HostType::H_OPAQUE:
|
||||
return value_.domain_or_opaque;
|
||||
- break;
|
||||
case HostType::H_IPV4: {
|
||||
dest.reserve(15);
|
||||
uint32_t value = value_.ipv4;
|
||||
@@ -7,7 +7,7 @@ common.gypi is a file that's included in the node header bundle, despite
|
||||
the fact that we do not build node with gyp.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 013f24b107408f757f4bdb950be519f61bc5358b..75fc36bc3c0eee65a6bb00ec31c79aabf3bb7dde 100644
|
||||
index 7bc2b3abf470193640b40824ffb17891088cabfb..c222ed20be858544d454c59192889132eaa9e1ee 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -81,6 +81,23 @@
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: fix: add v8_enable_reverse_jsargs defines in common.gypi
|
||||
This can be removed once node upgrades V8 and inevitably has to do this exact same thing. Also hi node people if you are looking at this.
|
||||
|
||||
diff --git a/common.gypi b/common.gypi
|
||||
index 82722da38f0027626e204dd7a33f7bc5e070059d..f330d4e92a585d7d72e8322cebb5606fe7220e8c 100644
|
||||
index 4f352dea639cc9ab8913b915d35df4edf4fb6a06..63c7d2b1da5f1c83f02f856e0d14198bfed6787e 100644
|
||||
--- a/common.gypi
|
||||
+++ b/common.gypi
|
||||
@@ -65,6 +65,7 @@
|
||||
@@ -25,7 +25,7 @@ index 82722da38f0027626e204dd7a33f7bc5e070059d..f330d4e92a585d7d72e8322cebb5606f
|
||||
##### end V8 defaults #####
|
||||
|
||||
# When building native modules using 'npm install' with the system npm,
|
||||
@@ -384,6 +386,9 @@
|
||||
@@ -385,6 +387,9 @@
|
||||
['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', {
|
||||
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'],
|
||||
}],
|
||||
|
||||
@@ -36,11 +36,11 @@ index 523d252e08974a10f9a53fb46d3345669cec3380..5bf19a0dda42849159d954181058897c
|
||||
#endif
|
||||
|
||||
diff --git a/src/env-inl.h b/src/env-inl.h
|
||||
index 061897d95d8b5f61968c59260e609d7be724b88f..7c7ee3207089bf3e51db646a367bdd6deba18628 100644
|
||||
index 2b000ed9ace5f73bfe0e8cab3e83ce94804f9c55..a1690712c457534d70db777cb722537913f86a0e 100644
|
||||
--- a/src/env-inl.h
|
||||
+++ b/src/env-inl.h
|
||||
@@ -881,6 +881,10 @@ inline bool Environment::hide_console_windows() const {
|
||||
return flags_ & EnvironmentFlags::kHideConsoleWindows;
|
||||
@@ -891,6 +891,10 @@ inline bool Environment::no_global_search_paths() const {
|
||||
!options_->global_search_paths;
|
||||
}
|
||||
|
||||
+inline bool Environment::should_initialize_inspector() const {
|
||||
@@ -51,31 +51,31 @@ index 061897d95d8b5f61968c59260e609d7be724b88f..7c7ee3207089bf3e51db646a367bdd6d
|
||||
return emit_filehandle_warning_;
|
||||
}
|
||||
diff --git a/src/env.h b/src/env.h
|
||||
index 4fd5be8e15029b65d61982aa32eba2cd27957fce..b38a69fc06a189569524df767dbbbe5c1985aa20 100644
|
||||
index f055e6b45013d9f8c039c662981bfd54f08266f6..d31512ae37fba212a20cf306be46f7dfadeabd6a 100644
|
||||
--- a/src/env.h
|
||||
+++ b/src/env.h
|
||||
@@ -1202,6 +1202,7 @@ class Environment : public MemoryRetainer {
|
||||
inline bool owns_inspector() const;
|
||||
@@ -1204,6 +1204,7 @@ class Environment : public MemoryRetainer {
|
||||
inline bool tracks_unmanaged_fds() const;
|
||||
inline bool hide_console_windows() const;
|
||||
inline bool no_global_search_paths() const;
|
||||
+ inline bool should_initialize_inspector() const;
|
||||
inline uint64_t thread_id() const;
|
||||
inline worker::Worker* worker_context() const;
|
||||
Environment* worker_parent_env() const;
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index b7f3e97873ef90b635e0648639f1a287a0bd88fa..48e378079f6d05e7cc1141a8875450b125028789 100644
|
||||
index 364f789fbcbec8e3234961294698d8e69b04a310..85b5ac6a5a5cb5e4388a92a1d07c9afe17140a8c 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -409,7 +409,11 @@ enum Flags : uint64_t {
|
||||
// Set this flag to force hiding console windows when spawning child
|
||||
// processes. This is usually used when embedding Node.js in GUI programs on
|
||||
// Windows.
|
||||
- kHideConsoleWindows = 1 << 5
|
||||
+ kHideConsoleWindows = 1 << 5,
|
||||
@@ -420,7 +420,11 @@ enum Flags : uint64_t {
|
||||
// $HOME/.node_modules and $NODE_PATH. This is used by standalone apps that
|
||||
// do not expect to have their behaviors changed because of globally
|
||||
// installed modules.
|
||||
- kNoGlobalSearchPaths = 1 << 7
|
||||
+ kNoGlobalSearchPaths = 1 << 7,
|
||||
+ // Controls whether or not the Environment should call InitializeInspector.
|
||||
+ // This control is needed by embedders who may not want to initialize the V8
|
||||
+ // inspector in situations where it already exists.
|
||||
+ kNoInitializeInspector = 1 << 6
|
||||
+ kNoInitializeInspector = 1 << 8
|
||||
};
|
||||
} // namespace EnvironmentFlags
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Date: Thu, 23 Sep 2021 12:29:23 +0200
|
||||
Subject: fix: crash creating private key with unsupported algorithm
|
||||
|
||||
This patch fixes an issue where some calls to crypto.createPrivateKey
|
||||
made with algorithms unsupported by BoringSSL cause a crash when invoking
|
||||
methods on their return values. This was happening because BoringSSL
|
||||
shims some algorithms but doesn't implement them and so attempted to
|
||||
created keys with them will fail (see https://source.chromium.org/chromium/chromium/src/+/main:third_party/boringssl/src/include/openssl/evp.h;l=835-837?q=ed448&ss=chromium)
|
||||
|
||||
Node.js returned false in initEdRaw (see: https://github.com/nodejs/node/blob/20cf47004e7801ede1588d2de8785c0100f6ab38/src/crypto/crypto_keys.cc#L1106)
|
||||
but then did nothing with the return value, meaning that if no pkey was
|
||||
created successfully that a key object was still returned but attempts
|
||||
to use the data_ field would crash the process as data_ was never
|
||||
assigned. This is fixed by checking the return value of initEdRaw at the
|
||||
JavaScript level and throwing an error if the function returns false.
|
||||
|
||||
This patch will be upstreamed in some form.
|
||||
|
||||
diff --git a/lib/internal/crypto/keys.js b/lib/internal/crypto/keys.js
|
||||
index ce053fbb4b800a67adcd5642a6ef09f8f2a21ce6..1b0e4b8791cf422bba331b242cd7df29b18c9da8 100644
|
||||
--- a/lib/internal/crypto/keys.js
|
||||
+++ b/lib/internal/crypto/keys.js
|
||||
@@ -436,15 +436,19 @@ function getKeyObjectHandleFromJwk(key, ctx) {
|
||||
|
||||
const handle = new KeyObjectHandle();
|
||||
if (isPublic) {
|
||||
- handle.initEDRaw(
|
||||
+ if (!handle.initEDRaw(
|
||||
`NODE-${key.crv.toUpperCase()}`,
|
||||
keyData,
|
||||
- kKeyTypePublic);
|
||||
+ kKeyTypePublic)) {
|
||||
+ throw new Error('Failed to create key - unsupported algorithm');
|
||||
+ }
|
||||
} else {
|
||||
- handle.initEDRaw(
|
||||
+ if (!handle.initEDRaw(
|
||||
`NODE-${key.crv.toUpperCase()}`,
|
||||
keyData,
|
||||
- kKeyTypePrivate);
|
||||
+ kKeyTypePrivate)) {
|
||||
+ throw new Error('Failed to create key - unsupported algorithm');
|
||||
+ }
|
||||
}
|
||||
|
||||
return handle;
|
||||
@@ -508,306 +508,6 @@ index af2146982c7a3bf7bd7527f44e4b17a3b605026e..f6b91f675cfea367c608892dee078b56
|
||||
|
||||
// Non-XOF hash functions should accept valid outputLength options as well.
|
||||
assert.strictEqual(crypto.createHash('sha224', { outputLength: 28 })
|
||||
diff --git a/test/parallel/test-crypto-key-objects.js b/test/parallel/test-crypto-key-objects.js
|
||||
index c2c47a9ce72f124c78f2743cf88ccd96d714fa1b..fcdbad0262fa1dd8a7858f255d0e5e45a470f72a 100644
|
||||
--- a/test/parallel/test-crypto-key-objects.js
|
||||
+++ b/test/parallel/test-crypto-key-objects.js
|
||||
@@ -307,11 +307,11 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
}, common.hasOpenSSL3 ? {
|
||||
message: 'error:1E08010C:DECODER routines::unsupported',
|
||||
} : {
|
||||
- message: 'error:0909006C:PEM routines:get_name:no start line',
|
||||
- code: 'ERR_OSSL_PEM_NO_START_LINE',
|
||||
- reason: 'no start line',
|
||||
- library: 'PEM routines',
|
||||
- function: 'get_name',
|
||||
+ message: /error:2007E073:BIO routines:BIO_new_mem_buf:null parameter|error:0900006e:PEM routines:OPENSSL_internal:NO_START_LINE/,
|
||||
+ code: /ERR_OSSL_BIO_NULL_PARAMETER|ERR_OSSL_PEM_NO_START_LINE/,
|
||||
+ reason: /null parameter|NO_START_LINE/,
|
||||
+ library: /BIO routines|PEM routines/,
|
||||
+ function: /BIO_new_mem_buf|OPENSSL_internal/,
|
||||
});
|
||||
|
||||
// This should not abort either: https://github.com/nodejs/node/issues/29904
|
||||
@@ -334,8 +334,8 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
message: /error:1E08010C:DECODER routines::unsupported/,
|
||||
library: 'DECODER routines'
|
||||
} : {
|
||||
- message: /asn1 encoding/,
|
||||
- library: 'asn1 encoding routines'
|
||||
+ message: /asn1 encoding|DECODE_ERROR/,
|
||||
+ library: /asn1 encoding routines|public key routines/
|
||||
});
|
||||
}
|
||||
|
||||
@@ -349,6 +349,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
d: 'wVK6M3SMhQh3NK-7GRrSV-BVWQx1FO5pW8hhQeu_NdA',
|
||||
kty: 'OKP'
|
||||
} },
|
||||
+/*
|
||||
{ private: fixtures.readKey('ed448_private.pem', 'ascii'),
|
||||
public: fixtures.readKey('ed448_public.pem', 'ascii'),
|
||||
keyType: 'ed448',
|
||||
@@ -380,6 +381,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
'S0jlSYJk',
|
||||
kty: 'OKP'
|
||||
} },
|
||||
+*/
|
||||
].forEach((info) => {
|
||||
const keyType = info.keyType;
|
||||
|
||||
@@ -421,7 +423,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
}
|
||||
}
|
||||
});
|
||||
-
|
||||
+/*
|
||||
[
|
||||
{ private: fixtures.readKey('ec_p256_private.pem', 'ascii'),
|
||||
public: fixtures.readKey('ec_p256_public.pem', 'ascii'),
|
||||
@@ -514,7 +516,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
}
|
||||
}
|
||||
});
|
||||
-
|
||||
+*/
|
||||
{
|
||||
// Reading an encrypted key without a passphrase should fail.
|
||||
assert.throws(() => createPrivateKey(privateDsa), common.hasOpenSSL3 ? {
|
||||
@@ -546,7 +548,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
}), {
|
||||
message: common.hasOpenSSL3 ?
|
||||
'error:1E08010C:DECODER routines::unsupported' :
|
||||
- /bad decrypt/
|
||||
+ /bad decrypt|error:1e000065:Cipher functions:OPENSSL_internal:BAD_DECRYPT/
|
||||
});
|
||||
|
||||
const publicKey = createPublicKey(publicDsa);
|
||||
@@ -569,7 +571,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
() => privateKey.export({ format: 'jwk' }),
|
||||
{ code: 'ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE' });
|
||||
}
|
||||
-
|
||||
+/*
|
||||
{
|
||||
// Test RSA-PSS.
|
||||
{
|
||||
@@ -767,7 +769,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
|
||||
}
|
||||
}
|
||||
}
|
||||
-
|
||||
+*/
|
||||
{
|
||||
// Exporting an encrypted private key requires a cipher
|
||||
const privateKey = createPrivateKey(privatePem);
|
||||
diff --git a/test/parallel/test-crypto-keygen.js b/test/parallel/test-crypto-keygen.js
|
||||
index 09d43317426e712f60d4eba380cd4e044e3f3cf8..43c274b96fbb1c4d8398e2d32b625da21e85d6a6 100644
|
||||
--- a/test/parallel/test-crypto-keygen.js
|
||||
+++ b/test/parallel/test-crypto-keygen.js
|
||||
@@ -297,6 +297,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
}));
|
||||
}
|
||||
|
||||
+/*
|
||||
{
|
||||
// Test RSA-PSS.
|
||||
generateKeyPair('rsa-pss', {
|
||||
@@ -345,7 +346,9 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
testSignVerify(publicKey, privateKey);
|
||||
}));
|
||||
}
|
||||
+*/
|
||||
|
||||
+/*
|
||||
{
|
||||
// 'rsa-pss' should not add a RSASSA-PSS-params sequence by default.
|
||||
// Regression test for: https://github.com/nodejs/node/issues/39936
|
||||
@@ -368,7 +371,9 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
assert.strictEqual(spki[3], 11, spki.toString('hex'));
|
||||
}));
|
||||
}
|
||||
+*/
|
||||
|
||||
+/*
|
||||
{
|
||||
const privateKeyEncoding = {
|
||||
type: 'pkcs8',
|
||||
@@ -417,6 +422,9 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
});
|
||||
}));
|
||||
}
|
||||
+*/
|
||||
+
|
||||
+/*
|
||||
{
|
||||
// Test async DSA key object generation.
|
||||
generateKeyPair('dsa', {
|
||||
@@ -438,7 +446,9 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
});
|
||||
}));
|
||||
}
|
||||
+*/
|
||||
|
||||
+/*
|
||||
{
|
||||
// Test async elliptic curve key generation, e.g. for ECDSA, with a SEC1
|
||||
// private key.
|
||||
@@ -552,8 +562,10 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
testSignVerify(publicKey, { key: privateKey, passphrase: 'secret' });
|
||||
}));
|
||||
}
|
||||
+*/
|
||||
|
||||
{
|
||||
+ /*
|
||||
// Test async elliptic curve key generation, e.g. for ECDSA, with an encrypted
|
||||
// private key.
|
||||
generateKeyPair('ec', {
|
||||
@@ -590,9 +602,11 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
passphrase: 'top secret'
|
||||
});
|
||||
}));
|
||||
+ */
|
||||
|
||||
// Test async elliptic curve key generation, e.g. for ECDSA, with an encrypted
|
||||
// private key with paramEncoding explicit.
|
||||
+ /*
|
||||
generateKeyPair('ec', {
|
||||
namedCurve: 'P-256',
|
||||
paramEncoding: 'explicit',
|
||||
@@ -627,15 +641,16 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
passphrase: 'top secret'
|
||||
});
|
||||
}));
|
||||
+ */
|
||||
|
||||
// Test async elliptic curve key generation with 'jwk' encoding
|
||||
[
|
||||
- ['ec', ['P-384', 'P-256', 'P-521', 'secp256k1']],
|
||||
+ ['ec', ['P-384', 'P-256', 'P-521', /*'secp256k1'*/]],
|
||||
['rsa'],
|
||||
['ed25519'],
|
||||
- ['ed448'],
|
||||
+ // ['ed448'],
|
||||
['x25519'],
|
||||
- ['x448'],
|
||||
+ // ['x448'],
|
||||
].forEach((types) => {
|
||||
const [type, options] = types;
|
||||
switch (type) {
|
||||
@@ -738,6 +753,8 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
message: "The property 'options.paramEncoding' is invalid. " +
|
||||
"Received 'otherEncoding'"
|
||||
});
|
||||
+
|
||||
+ /*
|
||||
assert.throws(() => generateKeyPairSync('dsa', {
|
||||
modulusLength: 4096,
|
||||
publicKeyEncoding: {
|
||||
@@ -751,6 +768,8 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
code: 'ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE',
|
||||
message: 'Unsupported JWK Key Type.'
|
||||
});
|
||||
+ */
|
||||
+
|
||||
assert.throws(() => generateKeyPairSync('ec', {
|
||||
namedCurve: 'secp224r1',
|
||||
publicKeyEncoding: {
|
||||
@@ -1089,6 +1108,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
}
|
||||
}
|
||||
|
||||
+/*
|
||||
// Test DSA parameters.
|
||||
{
|
||||
// Test invalid modulus lengths.
|
||||
@@ -1116,6 +1136,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
});
|
||||
}
|
||||
}
|
||||
+*/
|
||||
|
||||
// Test EC parameters.
|
||||
{
|
||||
@@ -1160,13 +1181,13 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
}));
|
||||
|
||||
generateKeyPair('ec', {
|
||||
- namedCurve: 'secp256k1',
|
||||
+ namedCurve: 'secp521r1',
|
||||
}, common.mustSucceed((publicKey, privateKey) => {
|
||||
assert.deepStrictEqual(publicKey.asymmetricKeyDetails, {
|
||||
- namedCurve: 'secp256k1'
|
||||
+ namedCurve: 'secp521r1'
|
||||
});
|
||||
assert.deepStrictEqual(privateKey.asymmetricKeyDetails, {
|
||||
- namedCurve: 'secp256k1'
|
||||
+ namedCurve: 'secp521r1'
|
||||
});
|
||||
}));
|
||||
}
|
||||
@@ -1174,7 +1195,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
// Test EdDSA key generation.
|
||||
{
|
||||
if (!/^1\.1\.0/.test(process.versions.openssl)) {
|
||||
- ['ed25519', 'ed448', 'x25519', 'x448'].forEach((keyType) => {
|
||||
+ ['ed25519'/*, 'ed448', 'x25519', 'x448'*/].forEach((keyType) => {
|
||||
generateKeyPair(keyType, common.mustSucceed((publicKey, privateKey) => {
|
||||
assert.strictEqual(publicKey.type, 'public');
|
||||
assert.strictEqual(publicKey.asymmetricKeyType, keyType);
|
||||
@@ -1188,6 +1209,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
}
|
||||
}
|
||||
|
||||
+/*
|
||||
// Test classic Diffie-Hellman key generation.
|
||||
{
|
||||
generateKeyPair('dh', {
|
||||
@@ -1300,6 +1322,7 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
||||
});
|
||||
}
|
||||
}
|
||||
+*/
|
||||
|
||||
// Test invalid key encoding types.
|
||||
{
|
||||
@@ -1500,6 +1523,7 @@ if (!common.hasOpenSSL3) {
|
||||
}, common.mustSucceed((publicKey, privateKey) => {
|
||||
assert.strictEqual(publicKey.type, 'public');
|
||||
|
||||
+ /*
|
||||
for (const passphrase of ['', Buffer.alloc(0)]) {
|
||||
const privateKeyObject = createPrivateKey({
|
||||
passphrase,
|
||||
@@ -1507,6 +1531,7 @@ if (!common.hasOpenSSL3) {
|
||||
});
|
||||
assert.strictEqual(privateKeyObject.asymmetricKeyType, 'rsa');
|
||||
}
|
||||
+ */
|
||||
|
||||
// Encrypting with an empty passphrase is not the same as not encrypting
|
||||
// the key, and not specifying a passphrase should fail when decoding it.
|
||||
diff --git a/test/parallel/test-crypto-padding-aes256.js b/test/parallel/test-crypto-padding-aes256.js
|
||||
index 14d853bdfd0a5dcc5bdb6e00cb20fdbeaabd2aff..3ae6fc47d4c6a8296a2c3c70daf464fad886a88d 100644
|
||||
--- a/test/parallel/test-crypto-padding-aes256.js
|
||||
+++ b/test/parallel/test-crypto-padding-aes256.js
|
||||
@@ -32,13 +32,13 @@ const key = Buffer.from('0123456789abcdef0123456789abcdef' +
|
||||
'0123456789abcdef0123456789abcdef', 'hex');
|
||||
|
||||
function encrypt(val, pad) {
|
||||
- const c = crypto.createCipheriv('aes256', key, iv);
|
||||
+ const c = crypto.createCipheriv('aes-256-cbc', key, iv);
|
||||
c.setAutoPadding(pad);
|
||||
return c.update(val, 'utf8', 'latin1') + c.final('latin1');
|
||||
}
|
||||
|
||||
function decrypt(val, pad) {
|
||||
- const c = crypto.createDecipheriv('aes256', key, iv);
|
||||
+ const c = crypto.createDecipheriv('aes-256-cbc', key, iv);
|
||||
c.setAutoPadding(pad);
|
||||
return c.update(val, 'latin1', 'utf8') + c.final('utf8');
|
||||
}
|
||||
diff --git a/test/parallel/test-crypto-padding.js b/test/parallel/test-crypto-padding.js
|
||||
index f1f14b472997e76bb4100edb1c6cf4fc24d1074d..5057e3f9bc5bb78aceffa5e79530f8ceed84e6f7 100644
|
||||
--- a/test/parallel/test-crypto-padding.js
|
||||
@@ -1260,10 +960,10 @@ index 151eebd36c9765df086a020ba42920b2442b1b77..efe97ff2499cba909ac5500d827364fa
|
||||
}
|
||||
|
||||
diff --git a/test/parallel/test-webcrypto-export-import-rsa.js b/test/parallel/test-webcrypto-export-import-rsa.js
|
||||
index 04cf6388fc739d3eab0a8d47857590c7a9b84342..d111e697db652b98dd8a9eb7869b1a98ba6bca79 100644
|
||||
index ab7aa77394ac9989514b7a184900092bd6753996..b0104ac45867a923a8c651e01e8c6975a62f7c61 100644
|
||||
--- a/test/parallel/test-webcrypto-export-import-rsa.js
|
||||
+++ b/test/parallel/test-webcrypto-export-import-rsa.js
|
||||
@@ -480,6 +480,7 @@ const testVectors = [
|
||||
@@ -481,6 +481,7 @@ const testVectors = [
|
||||
await Promise.all(variations);
|
||||
})().then(common.mustCall());
|
||||
|
||||
@@ -1271,11 +971,14 @@ index 04cf6388fc739d3eab0a8d47857590c7a9b84342..d111e697db652b98dd8a9eb7869b1a98
|
||||
{
|
||||
const publicPem = fixtures.readKey('rsa_pss_public_2048.pem', 'ascii');
|
||||
const privatePem = fixtures.readKey('rsa_pss_private_2048.pem', 'ascii');
|
||||
@@ -521,3 +522,4 @@ const testVectors = [
|
||||
@@ -522,6 +523,7 @@ const testVectors = [
|
||||
assert.strictEqual(jwk.alg, 'PS256');
|
||||
})().then(common.mustCall());
|
||||
}
|
||||
+*/
|
||||
|
||||
{
|
||||
const ecPublic = crypto.createPublicKey(
|
||||
diff --git a/test/parallel/test-webcrypto-wrap-unwrap.js b/test/parallel/test-webcrypto-wrap-unwrap.js
|
||||
index 1094845c73e14313860ad476fb7baba2a11b5af4..51972b4b34b191ac59145889dbf2da5c0d407dbe 100644
|
||||
--- a/test/parallel/test-webcrypto-wrap-unwrap.js
|
||||
|
||||
@@ -22,7 +22,7 @@ index 0fb750c5abbe00740f2095ec397c823e26666199..523d252e08974a10f9a53fb46d334566
|
||||
int thread_pool_size,
|
||||
node::tracing::TracingController* tracing_controller) {
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 09cb7a317cc46e88e5d214996dc87dc6e8730b1a..b7f3e97873ef90b635e0648639f1a287a0bd88fa 100644
|
||||
index 45de72bd94cf669ac2badf89d23164cb7022a5b3..364f789fbcbec8e3234961294698d8e69b04a310 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -118,6 +118,7 @@ namespace node {
|
||||
@@ -33,7 +33,7 @@ index 09cb7a317cc46e88e5d214996dc87dc6e8730b1a..b7f3e97873ef90b635e0648639f1a287
|
||||
class TracingController;
|
||||
|
||||
}
|
||||
@@ -488,6 +489,8 @@ NODE_EXTERN v8::MaybeLocal<v8::Value> PrepareStackTraceCallback(
|
||||
@@ -499,6 +500,8 @@ NODE_EXTERN v8::MaybeLocal<v8::Value> PrepareStackTraceCallback(
|
||||
NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(Environment* env);
|
||||
NODE_EXTERN MultiIsolatePlatform* GetMultiIsolatePlatform(IsolateData* env);
|
||||
|
||||
|
||||
@@ -222,10 +222,10 @@ index 7cb4513f9ad0eaadd055b169520ae1e5073b7e2d..50a6663966cdb147a702df21240fa449
|
||||
THROW_ERR_CRYPTO_OPERATION_FAILED(env, "could not generate prime");
|
||||
return Nothing<bool>();
|
||||
diff --git a/src/crypto/crypto_rsa.cc b/src/crypto/crypto_rsa.cc
|
||||
index 1bbf9a1753e4e2d82c55c4187489c22867d1d9bb..585af1674e129dc4d1c918d29fe9915bac8b4163 100644
|
||||
index d2307c33f5de8733b1343225a3fe6a700d1f51e4..fd31caa1355cd7be98992411b9cda2dbb500f211 100644
|
||||
--- a/src/crypto/crypto_rsa.cc
|
||||
+++ b/src/crypto/crypto_rsa.cc
|
||||
@@ -566,7 +566,7 @@ Maybe<bool> GetRsaKeyDetail(
|
||||
@@ -580,7 +580,7 @@ Maybe<bool> GetRsaKeyDetail(
|
||||
// In that case, RSA_get0_pss_params does not return nullptr but all fields
|
||||
// of the returned RSA_PSS_PARAMS will be set to nullptr.
|
||||
|
||||
@@ -234,7 +234,7 @@ index 1bbf9a1753e4e2d82c55c4187489c22867d1d9bb..585af1674e129dc4d1c918d29fe9915b
|
||||
if (params != nullptr) {
|
||||
int hash_nid = NID_sha1;
|
||||
int mgf_nid = NID_mgf1;
|
||||
@@ -607,10 +607,11 @@ Maybe<bool> GetRsaKeyDetail(
|
||||
@@ -621,10 +621,11 @@ Maybe<bool> GetRsaKeyDetail(
|
||||
}
|
||||
|
||||
if (params->saltLength != nullptr) {
|
||||
@@ -251,7 +251,7 @@ index 1bbf9a1753e4e2d82c55c4187489c22867d1d9bb..585af1674e129dc4d1c918d29fe9915b
|
||||
|
||||
if (target
|
||||
diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc
|
||||
index f18304cd655842e999a39659315c4eb3ce1c0c6e..1aed0e7e88460cea63950f71dac502829d662cff 100644
|
||||
index 7e0c8ba3eb60db88af8ba75e41e593dab86d2714..5c528c810256872c76dc7ba5a673d28652c405e1 100644
|
||||
--- a/src/crypto/crypto_util.cc
|
||||
+++ b/src/crypto/crypto_util.cc
|
||||
@@ -491,24 +491,14 @@ Maybe<bool> Decorate(Environment* env, Local<Object> obj,
|
||||
|
||||
@@ -40,7 +40,7 @@ index 5bf19a0dda42849159d954181058897c45d280fd..03078ff3869fcd17101f1cdaf77f725d
|
||||
|
||||
MaybeLocal<Object> GetPerContextExports(Local<Context> context) {
|
||||
diff --git a/src/node.h b/src/node.h
|
||||
index 48e378079f6d05e7cc1141a8875450b125028789..22e095804bca9d73d22707169c5aff2b13994344 100644
|
||||
index 85b5ac6a5a5cb5e4388a92a1d07c9afe17140a8c..4201c0d0460b032721ef42a26d79c38a9ee20c24 100644
|
||||
--- a/src/node.h
|
||||
+++ b/src/node.h
|
||||
@@ -313,7 +313,8 @@ class NODE_EXTERN MultiIsolatePlatform : public v8::Platform {
|
||||
@@ -53,7 +53,7 @@ index 48e378079f6d05e7cc1141a8875450b125028789..22e095804bca9d73d22707169c5aff2b
|
||||
};
|
||||
|
||||
enum IsolateSettingsFlags {
|
||||
@@ -498,7 +499,8 @@ NODE_EXTERN node::tracing::Agent* CreateAgent();
|
||||
@@ -509,7 +510,8 @@ NODE_EXTERN node::tracing::Agent* CreateAgent();
|
||||
NODE_DEPRECATED("Use MultiIsolatePlatform::Create() instead",
|
||||
NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
|
||||
int thread_pool_size,
|
||||
|
||||
@@ -7,3 +7,6 @@ do_not_export_private_v8_symbols_on_windows.patch
|
||||
fix_build_deprecated_attirbute_for_older_msvc_versions.patch
|
||||
fix_disable_implies_dcheck_for_node_stream_array_buffers.patch
|
||||
cppgc-js_support_eager_traced_value_in_ephemeron_pairs.patch
|
||||
regexp_add_a_currently_failing_cctest_for_irregexp_reentrancy.patch
|
||||
regexp_allow_reentrant_irregexp_execution.patch
|
||||
regexp_remove_the_stack_parameter_from_regexp_matchers.patch
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jakob Gruber <jgruber@chromium.org>
|
||||
Date: Mon, 6 Sep 2021 08:29:33 +0200
|
||||
Subject: Add a (currently failing) cctest for irregexp reentrancy
|
||||
|
||||
The test should be enabled once reentrancy is supported.
|
||||
|
||||
Bug: v8:11382
|
||||
Change-Id: Ifb90d8a6fd8bf9f05e9ca2405d4e04e013ce7ee3
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3138201
|
||||
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
|
||||
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
|
||||
Reviewed-by: Patrick Thier <pthier@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#76667}
|
||||
|
||||
diff --git a/test/cctest/cctest.status b/test/cctest/cctest.status
|
||||
index 0a6626ce332ae3ad3e49cb99404646c22c866b71..9c28520ed56998173c105b9d8a2ca3c4489b916e 100644
|
||||
--- a/test/cctest/cctest.status
|
||||
+++ b/test/cctest/cctest.status
|
||||
@@ -136,6 +136,9 @@
|
||||
'test-strings/Traverse': [PASS, HEAVY],
|
||||
'test-swiss-name-dictionary-csa/DeleteAtBoundaries': [PASS, HEAVY],
|
||||
'test-swiss-name-dictionary-csa/SameH2': [PASS, HEAVY],
|
||||
+
|
||||
+ # TODO(v8:11382): Reenable once irregexp is reentrant.
|
||||
+ 'test-regexp/RegExpInterruptReentrantExecution': [FAIL],
|
||||
}], # ALWAYS
|
||||
|
||||
##############################################################################
|
||||
@@ -670,6 +673,9 @@
|
||||
|
||||
# Instruction cache flushing is disabled in jitless mode.
|
||||
'test-icache/*': [SKIP],
|
||||
+
|
||||
+ # Tests generated irregexp code.
|
||||
+ 'test-regexp/RegExpInterruptReentrantExecution': [SKIP],
|
||||
}], # lite_mode or variant == jitless
|
||||
|
||||
##############################################################################
|
||||
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
|
||||
index dc5e2ea50898fbf684f5f4655d8b50982d4ebbbd..f7cbc54499464acf1a7de45251a6118340ec51fd 100644
|
||||
--- a/test/cctest/test-api.cc
|
||||
+++ b/test/cctest/test-api.cc
|
||||
@@ -21734,10 +21734,6 @@ TEST(RegExpInterruptAndMakeSubjectTwoByteExternal) {
|
||||
// experimental engine.
|
||||
i::FLAG_enable_experimental_regexp_engine_on_excessive_backtracks = false;
|
||||
RegExpInterruptTest test;
|
||||
- // We want to be stuck regexp execution, so no fallback to linear-time
|
||||
- // engine.
|
||||
- // TODO(mbid,v8:10765): Find a way to test interrupt support of the
|
||||
- // experimental engine.
|
||||
test.RunTest(RegExpInterruptTest::MakeSubjectTwoByteExternal);
|
||||
}
|
||||
|
||||
diff --git a/test/cctest/test-regexp.cc b/test/cctest/test-regexp.cc
|
||||
index 27204f7f519229cc4c21a10dd0a44222d4b6edd6..2692748e623d3d52780ff89a97f4300bcd981cbd 100644
|
||||
--- a/test/cctest/test-regexp.cc
|
||||
+++ b/test/cctest/test-regexp.cc
|
||||
@@ -2346,6 +2346,50 @@ TEST(UnicodePropertyEscapeCodeSize) {
|
||||
}
|
||||
}
|
||||
|
||||
+namespace {
|
||||
+
|
||||
+struct RegExpExecData {
|
||||
+ i::Isolate* isolate;
|
||||
+ i::Handle<i::JSRegExp> regexp;
|
||||
+ i::Handle<i::String> subject;
|
||||
+};
|
||||
+
|
||||
+i::Handle<i::Object> RegExpExec(const RegExpExecData* d) {
|
||||
+ return i::RegExp::Exec(d->isolate, d->regexp, d->subject, 0,
|
||||
+ d->isolate->regexp_last_match_info())
|
||||
+ .ToHandleChecked();
|
||||
+}
|
||||
+
|
||||
+void ReenterRegExp(v8::Isolate* isolate, void* data) {
|
||||
+ RegExpExecData* d = static_cast<RegExpExecData*>(data);
|
||||
+ i::Handle<i::Object> result = RegExpExec(d);
|
||||
+ CHECK(result->IsNull());
|
||||
+}
|
||||
+
|
||||
+} // namespace
|
||||
+
|
||||
+// Tests reentrant irregexp calls.
|
||||
+TEST(RegExpInterruptReentrantExecution) {
|
||||
+ CHECK(!i::FLAG_jitless);
|
||||
+ i::FLAG_regexp_tier_up = false; // Enter irregexp, not the interpreter.
|
||||
+
|
||||
+ LocalContext context;
|
||||
+ v8::Isolate* isolate = context->GetIsolate();
|
||||
+ v8::HandleScope scope(isolate);
|
||||
+
|
||||
+ RegExpExecData d;
|
||||
+ d.isolate = reinterpret_cast<i::Isolate*>(isolate);
|
||||
+ d.regexp = v8::Utils::OpenHandle(
|
||||
+ *v8::RegExp::New(context.local(), v8_str("(a*)*x"), v8::RegExp::kNone)
|
||||
+ .ToLocalChecked());
|
||||
+ d.subject = v8::Utils::OpenHandle(*v8_str("aaaa"));
|
||||
+
|
||||
+ isolate->RequestInterrupt(&ReenterRegExp, &d);
|
||||
+
|
||||
+ i::Handle<i::Object> result = RegExpExec(&d);
|
||||
+ CHECK(result->IsNull());
|
||||
+}
|
||||
+
|
||||
#undef CHECK_PARSE_ERROR
|
||||
#undef CHECK_SIMPLE
|
||||
#undef CHECK_MIN_MAX
|
||||
1736
patches/v8/regexp_allow_reentrant_irregexp_execution.patch
Normal file
1736
patches/v8/regexp_allow_reentrant_irregexp_execution.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,397 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jakob Gruber <jgruber@chromium.org>
|
||||
Date: Wed, 22 Sep 2021 14:42:48 +0200
|
||||
Subject: Remove the `stack` parameter from regexp matchers
|
||||
|
||||
The argument is no longer in use.
|
||||
|
||||
Bug: v8:11382
|
||||
Change-Id: I7febc7fe7ef17ae462c700f0dba3ca1beade3021
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3173681
|
||||
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
|
||||
Reviewed-by: Patrick Thier <pthier@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#77017}
|
||||
|
||||
diff --git a/src/builtins/builtins-regexp-gen.cc b/src/builtins/builtins-regexp-gen.cc
|
||||
index 6e4307b404405c4c78614a956c64b4a86f5fe0fe..6c2d3b44a39a6bcce4e48ac621b21f54371e9b6f 100644
|
||||
--- a/src/builtins/builtins-regexp-gen.cc
|
||||
+++ b/src/builtins/builtins-regexp-gen.cc
|
||||
@@ -436,8 +436,6 @@ TNode<HeapObject> RegExpBuiltinsAssembler::RegExpExecInternal(
|
||||
// External constants.
|
||||
TNode<ExternalReference> isolate_address =
|
||||
ExternalConstant(ExternalReference::isolate_address(isolate()));
|
||||
- TNode<ExternalReference> regexp_stack_memory_top_address = ExternalConstant(
|
||||
- ExternalReference::address_of_regexp_stack_memory_top_address(isolate()));
|
||||
TNode<ExternalReference> static_offsets_vector_address = ExternalConstant(
|
||||
ExternalReference::address_of_static_offsets_vector(isolate()));
|
||||
|
||||
@@ -606,26 +604,18 @@ TNode<HeapObject> RegExpBuiltinsAssembler::RegExpExecInternal(
|
||||
MachineType arg5_type = type_int32;
|
||||
TNode<Int32T> arg5 = SmiToInt32(register_count);
|
||||
|
||||
- // Argument 6: Start (high end) of backtracking stack memory area. This
|
||||
- // argument is ignored in the interpreter.
|
||||
- TNode<RawPtrT> stack_top = UncheckedCast<RawPtrT>(
|
||||
- Load(MachineType::Pointer(), regexp_stack_memory_top_address));
|
||||
+ // Argument 6: Indicate that this is a direct call from JavaScript.
|
||||
+ MachineType arg6_type = type_int32;
|
||||
+ TNode<Int32T> arg6 = Int32Constant(RegExp::CallOrigin::kFromJs);
|
||||
|
||||
- MachineType arg6_type = type_ptr;
|
||||
- TNode<RawPtrT> arg6 = stack_top;
|
||||
+ // Argument 7: Pass current isolate address.
|
||||
+ MachineType arg7_type = type_ptr;
|
||||
+ TNode<ExternalReference> arg7 = isolate_address;
|
||||
|
||||
- // Argument 7: Indicate that this is a direct call from JavaScript.
|
||||
- MachineType arg7_type = type_int32;
|
||||
- TNode<Int32T> arg7 = Int32Constant(RegExp::CallOrigin::kFromJs);
|
||||
-
|
||||
- // Argument 8: Pass current isolate address.
|
||||
- MachineType arg8_type = type_ptr;
|
||||
- TNode<ExternalReference> arg8 = isolate_address;
|
||||
-
|
||||
- // Argument 9: Regular expression object. This argument is ignored in native
|
||||
+ // Argument 8: Regular expression object. This argument is ignored in native
|
||||
// irregexp code.
|
||||
- MachineType arg9_type = type_tagged;
|
||||
- TNode<JSRegExp> arg9 = regexp;
|
||||
+ MachineType arg8_type = type_tagged;
|
||||
+ TNode<JSRegExp> arg8 = regexp;
|
||||
|
||||
// TODO(v8:11880): avoid roundtrips between cdc and code.
|
||||
TNode<RawPtrT> code_entry = LoadCodeObjectEntry(code);
|
||||
@@ -640,8 +630,7 @@ TNode<HeapObject> RegExpBuiltinsAssembler::RegExpExecInternal(
|
||||
std::make_pair(arg1_type, arg1), std::make_pair(arg2_type, arg2),
|
||||
std::make_pair(arg3_type, arg3), std::make_pair(arg4_type, arg4),
|
||||
std::make_pair(arg5_type, arg5), std::make_pair(arg6_type, arg6),
|
||||
- std::make_pair(arg7_type, arg7), std::make_pair(arg8_type, arg8),
|
||||
- std::make_pair(arg9_type, arg9)));
|
||||
+ std::make_pair(arg7_type, arg7), std::make_pair(arg8_type, arg8)));
|
||||
|
||||
// Check the result.
|
||||
// We expect exactly one result since we force the called regexp to behave
|
||||
diff --git a/src/regexp/arm/regexp-macro-assembler-arm.cc b/src/regexp/arm/regexp-macro-assembler-arm.cc
|
||||
index 10766db4cf1d41ad0fee0754c6eaeebe46ace500..6e79ffd8adf8417c356bb36e1dbb2d0bfc290858 100644
|
||||
--- a/src/regexp/arm/regexp-macro-assembler-arm.cc
|
||||
+++ b/src/regexp/arm/regexp-macro-assembler-arm.cc
|
||||
@@ -38,14 +38,12 @@ namespace internal {
|
||||
* Each call to a public method should retain this convention.
|
||||
*
|
||||
* The stack will have the following structure:
|
||||
- * - fp[56] Address regexp (address of the JSRegExp object; unused in
|
||||
+ * - fp[52] Address regexp (address of the JSRegExp object; unused in
|
||||
* native code, passed to match signature of
|
||||
* the interpreter)
|
||||
- * - fp[52] Isolate* isolate (address of the current isolate)
|
||||
- * - fp[48] direct_call (if 1, direct call from JavaScript code,
|
||||
+ * - fp[48] Isolate* isolate (address of the current isolate)
|
||||
+ * - fp[44] direct_call (if 1, direct call from JavaScript code,
|
||||
* if 0, call through the runtime system).
|
||||
- * - fp[44] stack_area_base (high end of the memory area to use as
|
||||
- * backtracking stack).
|
||||
* - fp[40] capture array size (may fit multiple sets of matches)
|
||||
* - fp[36] int* capture_array (int[num_saved_registers_], for output).
|
||||
* --- sp when called ---
|
||||
@@ -82,7 +80,6 @@ namespace internal {
|
||||
* Address end,
|
||||
* int* capture_output_array,
|
||||
* int num_capture_registers,
|
||||
- * byte* stack_area_base,
|
||||
* bool direct_call = false,
|
||||
* Isolate* isolate,
|
||||
* Address regexp);
|
||||
diff --git a/src/regexp/arm/regexp-macro-assembler-arm.h b/src/regexp/arm/regexp-macro-assembler-arm.h
|
||||
index a76f9dea70264d79d57ebd6c60b100bc9e0a499d..5aad6c1d85d574f4db307b6edcdda89ed25d5ca8 100644
|
||||
--- a/src/regexp/arm/regexp-macro-assembler-arm.h
|
||||
+++ b/src/regexp/arm/regexp-macro-assembler-arm.h
|
||||
@@ -91,15 +91,13 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerARM
|
||||
static const int kFramePointer = 0;
|
||||
|
||||
// Above the frame pointer - Stored registers and stack passed parameters.
|
||||
- // Register 4..11.
|
||||
static const int kStoredRegisters = kFramePointer;
|
||||
// Return address (stored from link register, read into pc on return).
|
||||
static const int kReturnAddress = kStoredRegisters + 8 * kPointerSize;
|
||||
// Stack parameters placed by caller.
|
||||
static const int kRegisterOutput = kReturnAddress + kPointerSize;
|
||||
static const int kNumOutputRegisters = kRegisterOutput + kPointerSize;
|
||||
- static const int kStackHighEnd = kNumOutputRegisters + kPointerSize;
|
||||
- static const int kDirectCall = kStackHighEnd + kPointerSize;
|
||||
+ static const int kDirectCall = kNumOutputRegisters + kPointerSize;
|
||||
static const int kIsolate = kDirectCall + kPointerSize;
|
||||
|
||||
// Below the frame pointer.
|
||||
diff --git a/src/regexp/arm64/regexp-macro-assembler-arm64.cc b/src/regexp/arm64/regexp-macro-assembler-arm64.cc
|
||||
index 6192461fa32879469d56d36fb788b5de33038d77..4611a323afacb5accfb3886581879e60eb1c9f12 100644
|
||||
--- a/src/regexp/arm64/regexp-macro-assembler-arm64.cc
|
||||
+++ b/src/regexp/arm64/regexp-macro-assembler-arm64.cc
|
||||
@@ -66,14 +66,12 @@ namespace internal {
|
||||
* ^^^^^^^^^ fp ^^^^^^^^^
|
||||
* - fp[-8] direct_call 1 => Direct call from JavaScript code.
|
||||
* 0 => Call through the runtime system.
|
||||
- * - fp[-16] stack_base High end of the memory area to use as
|
||||
- * the backtracking stack.
|
||||
- * - fp[-24] output_size Output may fit multiple sets of matches.
|
||||
- * - fp[-32] input Handle containing the input string.
|
||||
- * - fp[-40] success_counter
|
||||
+ * - fp[-16] output_size Output may fit multiple sets of matches.
|
||||
+ * - fp[-24] input Handle containing the input string.
|
||||
+ * - fp[-32] success_counter
|
||||
* ^^^^^^^^^^^^^ From here and downwards we store 32 bit values ^^^^^^^^^^^^^
|
||||
- * - fp[-44] register N Capture registers initialized with
|
||||
- * - fp[-48] register N + 1 non_position_value.
|
||||
+ * - fp[-40] register N Capture registers initialized with
|
||||
+ * - fp[-44] register N + 1 non_position_value.
|
||||
* ... The first kNumCachedRegisters (N) registers
|
||||
* ... are cached in x0 to x7.
|
||||
* ... Only positions must be stored in the first
|
||||
@@ -95,7 +93,6 @@ namespace internal {
|
||||
* Address end,
|
||||
* int* capture_output_array,
|
||||
* int num_capture_registers,
|
||||
- * byte* stack_area_base,
|
||||
* bool direct_call = false,
|
||||
* Isolate* isolate,
|
||||
* Address regexp);
|
||||
@@ -750,11 +747,10 @@ Handle<HeapObject> RegExpMacroAssemblerARM64::GetCode(Handle<String> source) {
|
||||
// x3: byte* input_end
|
||||
// x4: int* output array
|
||||
// x5: int output array size
|
||||
- // x6: Address stack_base
|
||||
- // x7: int direct_call
|
||||
-
|
||||
- // sp[8]: address of the current isolate
|
||||
- // sp[0]: secondary link/return address used by native call
|
||||
+ // x6: int direct_call
|
||||
+ // x7: Isolate* isolate
|
||||
+ //
|
||||
+ // sp[0]: secondary link/return address used by native call
|
||||
|
||||
// Tell the system that we have a stack frame. Because the type is MANUAL, no
|
||||
// code is generated.
|
||||
diff --git a/src/regexp/arm64/regexp-macro-assembler-arm64.h b/src/regexp/arm64/regexp-macro-assembler-arm64.h
|
||||
index 204ee68dc868142693e9959170c71df3f72f97ce..f3869a72b631f9fb42b275d2edd8f3cfe1cfd8bb 100644
|
||||
--- a/src/regexp/arm64/regexp-macro-assembler-arm64.h
|
||||
+++ b/src/regexp/arm64/regexp-macro-assembler-arm64.h
|
||||
@@ -102,16 +102,12 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerARM64
|
||||
// Callee-saved registers (x19-x28).
|
||||
static const int kNumCalleeSavedRegisters = 10;
|
||||
static const int kCalleeSavedRegisters = kReturnAddress + kSystemPointerSize;
|
||||
- // Stack parameter placed by caller.
|
||||
- // It is placed above the FP, LR and the callee-saved registers.
|
||||
- static const int kIsolate =
|
||||
- kCalleeSavedRegisters + kNumCalleeSavedRegisters * kSystemPointerSize;
|
||||
|
||||
// Below the frame pointer.
|
||||
// Register parameters stored by setup code.
|
||||
- static const int kDirectCall = -kSystemPointerSize;
|
||||
- static const int kStackHighEnd = kDirectCall - kSystemPointerSize;
|
||||
- static const int kOutputSize = kStackHighEnd - kSystemPointerSize;
|
||||
+ static const int kIsolate = -kSystemPointerSize;
|
||||
+ static const int kDirectCall = kIsolate - kSystemPointerSize;
|
||||
+ static const int kOutputSize = kDirectCall - kSystemPointerSize;
|
||||
static const int kInput = kOutputSize - kSystemPointerSize;
|
||||
// When adding local variables remember to push space for them in
|
||||
// the frame in GetCode.
|
||||
diff --git a/src/regexp/experimental/experimental.cc b/src/regexp/experimental/experimental.cc
|
||||
index c05a010d06f34405128ffb9a9d67d86a20fcb83d..c3d701715aa88be3f5a8009319a09b032c85f4ad 100644
|
||||
--- a/src/regexp/experimental/experimental.cc
|
||||
+++ b/src/regexp/experimental/experimental.cc
|
||||
@@ -192,8 +192,7 @@ int32_t ExperimentalRegExp::ExecRaw(Isolate* isolate,
|
||||
int32_t ExperimentalRegExp::MatchForCallFromJs(
|
||||
Address subject, int32_t start_position, Address input_start,
|
||||
Address input_end, int* output_registers, int32_t output_register_count,
|
||||
- Address backtrack_stack, RegExp::CallOrigin call_origin, Isolate* isolate,
|
||||
- Address regexp) {
|
||||
+ RegExp::CallOrigin call_origin, Isolate* isolate, Address regexp) {
|
||||
DCHECK(FLAG_enable_experimental_regexp_engine);
|
||||
DCHECK_NOT_NULL(isolate);
|
||||
DCHECK_NOT_NULL(output_registers);
|
||||
diff --git a/src/regexp/experimental/experimental.h b/src/regexp/experimental/experimental.h
|
||||
index 5987fb4d7732f47c5f31cc0fab7b11e252c864f8..cdc683e97e901bd3e63332a04f69c6d31f964931 100644
|
||||
--- a/src/regexp/experimental/experimental.h
|
||||
+++ b/src/regexp/experimental/experimental.h
|
||||
@@ -34,7 +34,6 @@ class ExperimentalRegExp final : public AllStatic {
|
||||
Address input_start, Address input_end,
|
||||
int* output_registers,
|
||||
int32_t output_register_count,
|
||||
- Address backtrack_stack,
|
||||
RegExp::CallOrigin call_origin,
|
||||
Isolate* isolate, Address regexp);
|
||||
static MaybeHandle<Object> Exec(
|
||||
diff --git a/src/regexp/ia32/regexp-macro-assembler-ia32.cc b/src/regexp/ia32/regexp-macro-assembler-ia32.cc
|
||||
index 51d63b2531e2bc85fb115de23d7b6a6f40b36f11..8369b88e22c300890fe4ddb1bbba62093e8b23d8 100644
|
||||
--- a/src/regexp/ia32/regexp-macro-assembler-ia32.cc
|
||||
+++ b/src/regexp/ia32/regexp-macro-assembler-ia32.cc
|
||||
@@ -40,8 +40,6 @@ namespace internal {
|
||||
* - Isolate* isolate (address of the current isolate)
|
||||
* - direct_call (if 1, direct call from JavaScript code, if 0
|
||||
* call through the runtime system)
|
||||
- * - stack_area_base (high end of the memory area to use as
|
||||
- * backtracking stack)
|
||||
* - capture array size (may fit multiple sets of matches)
|
||||
* - int* capture_array (int[num_saved_registers_], for output).
|
||||
* - end of input (address of end of string)
|
||||
@@ -74,7 +72,6 @@ namespace internal {
|
||||
* Address end,
|
||||
* int* capture_output_array,
|
||||
* int num_capture_registers,
|
||||
- * byte* stack_area_base,
|
||||
* bool direct_call = false,
|
||||
* Isolate* isolate
|
||||
* Address regexp);
|
||||
diff --git a/src/regexp/ia32/regexp-macro-assembler-ia32.h b/src/regexp/ia32/regexp-macro-assembler-ia32.h
|
||||
index 861795da900d91111386e4f8e660f7f94ea46a33..01914a6b8b5abb96a4eec8d844e2d1aea7cbf231 100644
|
||||
--- a/src/regexp/ia32/regexp-macro-assembler-ia32.h
|
||||
+++ b/src/regexp/ia32/regexp-macro-assembler-ia32.h
|
||||
@@ -105,8 +105,7 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerIA32
|
||||
// one set of capture results. For the case of non-global regexp, we ignore
|
||||
// this value.
|
||||
static const int kNumOutputRegisters = kRegisterOutput + kSystemPointerSize;
|
||||
- static const int kStackHighEnd = kNumOutputRegisters + kSystemPointerSize;
|
||||
- static const int kDirectCall = kStackHighEnd + kSystemPointerSize;
|
||||
+ static const int kDirectCall = kNumOutputRegisters + kSystemPointerSize;
|
||||
static const int kIsolate = kDirectCall + kSystemPointerSize;
|
||||
// Below the frame pointer - local stack variables.
|
||||
// When adding local variables remember to push space for them in
|
||||
diff --git a/src/regexp/regexp-interpreter.cc b/src/regexp/regexp-interpreter.cc
|
||||
index f9a959d2582a25cd60a97453e696f8f1f0560ce8..a2f23f78c308162240c5adf8904e732ce3bf6159 100644
|
||||
--- a/src/regexp/regexp-interpreter.cc
|
||||
+++ b/src/regexp/regexp-interpreter.cc
|
||||
@@ -1111,7 +1111,7 @@ IrregexpInterpreter::Result IrregexpInterpreter::MatchInternal(
|
||||
// builtin.
|
||||
IrregexpInterpreter::Result IrregexpInterpreter::MatchForCallFromJs(
|
||||
Address subject, int32_t start_position, Address, Address,
|
||||
- int* output_registers, int32_t output_register_count, Address,
|
||||
+ int* output_registers, int32_t output_register_count,
|
||||
RegExp::CallOrigin call_origin, Isolate* isolate, Address regexp) {
|
||||
DCHECK_NOT_NULL(isolate);
|
||||
DCHECK_NOT_NULL(output_registers);
|
||||
diff --git a/src/regexp/regexp-interpreter.h b/src/regexp/regexp-interpreter.h
|
||||
index a4d79184b08963598bbc42a91541c8df695bf4c5..e9dedd781b5b83d4017f8b2bd4353f1d57013a67 100644
|
||||
--- a/src/regexp/regexp-interpreter.h
|
||||
+++ b/src/regexp/regexp-interpreter.h
|
||||
@@ -36,9 +36,8 @@ class V8_EXPORT_PRIVATE IrregexpInterpreter : public AllStatic {
|
||||
// RETRY is returned if a retry through the runtime is needed (e.g. when
|
||||
// interrupts have been scheduled or the regexp is marked for tier-up).
|
||||
//
|
||||
- // Arguments input_start, input_end and backtrack_stack are
|
||||
- // unused. They are only passed to match the signature of the native irregex
|
||||
- // code.
|
||||
+ // Arguments input_start and input_end are unused. They are only passed to
|
||||
+ // match the signature of the native irregex code.
|
||||
//
|
||||
// Arguments output_registers and output_register_count describe the results
|
||||
// array, which will contain register values of all captures if SUCCESS is
|
||||
@@ -47,7 +46,6 @@ class V8_EXPORT_PRIVATE IrregexpInterpreter : public AllStatic {
|
||||
Address input_start, Address input_end,
|
||||
int* output_registers,
|
||||
int32_t output_register_count,
|
||||
- Address backtrack_stack,
|
||||
RegExp::CallOrigin call_origin,
|
||||
Isolate* isolate, Address regexp);
|
||||
|
||||
diff --git a/src/regexp/regexp-macro-assembler.cc b/src/regexp/regexp-macro-assembler.cc
|
||||
index 1f5875afb8850da4136da6633d5b0ad9f52803e3..ced89ad4386b9d037851529f098c8aa111f2a478 100644
|
||||
--- a/src/regexp/regexp-macro-assembler.cc
|
||||
+++ b/src/regexp/regexp-macro-assembler.cc
|
||||
@@ -306,23 +306,21 @@ int NativeRegExpMacroAssembler::Execute(
|
||||
String input, // This needs to be the unpacked (sliced, cons) string.
|
||||
int start_offset, const byte* input_start, const byte* input_end,
|
||||
int* output, int output_size, Isolate* isolate, JSRegExp regexp) {
|
||||
- // Ensure that the minimum stack has been allocated.
|
||||
RegExpStackScope stack_scope(isolate);
|
||||
- Address stack_base = stack_scope.stack()->memory_top();
|
||||
|
||||
bool is_one_byte = String::IsOneByteRepresentationUnderneath(input);
|
||||
Code code = FromCodeT(CodeT::cast(regexp.Code(is_one_byte)));
|
||||
RegExp::CallOrigin call_origin = RegExp::CallOrigin::kFromRuntime;
|
||||
|
||||
- using RegexpMatcherSig = int(
|
||||
- Address input_string, int start_offset, const byte* input_start,
|
||||
- const byte* input_end, int* output, int output_size, Address stack_base,
|
||||
- int call_origin, Isolate* isolate, Address regexp);
|
||||
+ using RegexpMatcherSig =
|
||||
+ // NOLINTNEXTLINE(readability/casting)
|
||||
+ int(Address input_string, int start_offset, const byte* input_start,
|
||||
+ const byte* input_end, int* output, int output_size, int call_origin,
|
||||
+ Isolate* isolate, Address regexp);
|
||||
|
||||
auto fn = GeneratedCode<RegexpMatcherSig>::FromCode(code);
|
||||
- int result =
|
||||
- fn.Call(input.ptr(), start_offset, input_start, input_end, output,
|
||||
- output_size, stack_base, call_origin, isolate, regexp.ptr());
|
||||
+ int result = fn.Call(input.ptr(), start_offset, input_start, input_end,
|
||||
+ output, output_size, call_origin, isolate, regexp.ptr());
|
||||
DCHECK_GE(result, SMALLEST_REGEXP_RESULT);
|
||||
|
||||
if (result == EXCEPTION && !isolate->has_pending_exception()) {
|
||||
diff --git a/src/regexp/x64/regexp-macro-assembler-x64.cc b/src/regexp/x64/regexp-macro-assembler-x64.cc
|
||||
index abcbed18aaa9bdc4a497962714bffde74d581173..e4bff5dafa9f12c14805c72e51f973252b97a5a7 100644
|
||||
--- a/src/regexp/x64/regexp-macro-assembler-x64.cc
|
||||
+++ b/src/regexp/x64/regexp-macro-assembler-x64.cc
|
||||
@@ -47,14 +47,12 @@ namespace internal {
|
||||
* Each call to a C++ method should retain these registers.
|
||||
*
|
||||
* The stack will have the following content, in some order, indexable from the
|
||||
- * frame pointer (see, e.g., kStackHighEnd):
|
||||
+ * frame pointer (see, e.g., kDirectCall):
|
||||
* - Address regexp (address of the JSRegExp object; unused in native
|
||||
* code, passed to match signature of interpreter)
|
||||
* - Isolate* isolate (address of the current isolate)
|
||||
* - direct_call (if 1, direct call from JavaScript code, if 0 call
|
||||
* through the runtime system)
|
||||
- * - stack_area_base (high end of the memory area to use as
|
||||
- * backtracking stack)
|
||||
* - capture array size (may fit multiple sets of matches)
|
||||
* - int* capture_array (int[num_saved_registers_], for output).
|
||||
* - end of input (address of end of string)
|
||||
@@ -85,7 +83,6 @@ namespace internal {
|
||||
* Address end,
|
||||
* int* capture_output_array,
|
||||
* int num_capture_registers,
|
||||
- * byte* stack_area_base,
|
||||
* bool direct_call = false,
|
||||
* Isolate* isolate,
|
||||
* Address regexp);
|
||||
@@ -849,8 +846,6 @@ Handle<HeapObject> RegExpMacroAssemblerX64::GetCode(Handle<String> source) {
|
||||
}
|
||||
|
||||
// Initialize backtrack stack pointer.
|
||||
- // TODO(jgruber): Remove the kStackHighEnd parameter (and others like
|
||||
- // kIsolate).
|
||||
LoadRegExpStackPointerFromMemory(backtrack_stackpointer());
|
||||
|
||||
__ jmp(&start_label_);
|
||||
diff --git a/src/regexp/x64/regexp-macro-assembler-x64.h b/src/regexp/x64/regexp-macro-assembler-x64.h
|
||||
index 74a3c95b06c771078ab03e6787e5912315421bb2..6f89ba9f8cf45430dc0edc7f2241a9aca34324c0 100644
|
||||
--- a/src/regexp/x64/regexp-macro-assembler-x64.h
|
||||
+++ b/src/regexp/x64/regexp-macro-assembler-x64.h
|
||||
@@ -108,9 +108,8 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerX64
|
||||
// this value. NumOutputRegisters is passed as 32-bit value. The upper
|
||||
// 32 bit of this 64-bit stack slot may contain garbage.
|
||||
static const int kNumOutputRegisters = kRegisterOutput + kSystemPointerSize;
|
||||
- static const int kStackHighEnd = kNumOutputRegisters + kSystemPointerSize;
|
||||
// DirectCall is passed as 32 bit int (values 0 or 1).
|
||||
- static const int kDirectCall = kStackHighEnd + kSystemPointerSize;
|
||||
+ static const int kDirectCall = kNumOutputRegisters + kSystemPointerSize;
|
||||
static const int kIsolate = kDirectCall + kSystemPointerSize;
|
||||
#else
|
||||
// In AMD64 ABI Calling Convention, the first six integer parameters
|
||||
@@ -121,13 +120,12 @@ class V8_EXPORT_PRIVATE RegExpMacroAssemblerX64
|
||||
static const int kInputStart = kStartIndex - kSystemPointerSize;
|
||||
static const int kInputEnd = kInputStart - kSystemPointerSize;
|
||||
static const int kRegisterOutput = kInputEnd - kSystemPointerSize;
|
||||
-
|
||||
// For the case of global regular expression, we have room to store at least
|
||||
// one set of capture results. For the case of non-global regexp, we ignore
|
||||
// this value.
|
||||
static const int kNumOutputRegisters = kRegisterOutput - kSystemPointerSize;
|
||||
- static const int kStackHighEnd = kFrameAlign;
|
||||
- static const int kDirectCall = kStackHighEnd + kSystemPointerSize;
|
||||
+
|
||||
+ static const int kDirectCall = kFrameAlign;
|
||||
static const int kIsolate = kDirectCall + kSystemPointerSize;
|
||||
#endif
|
||||
|
||||
@@ -232,9 +232,8 @@ def remove_patch_filename(patch):
|
||||
def export_patches(repo, out_dir, patch_range=None, dry_run=False):
|
||||
if patch_range is None:
|
||||
patch_range, num_patches = guess_base_commit(repo)
|
||||
sys.stderr.write(
|
||||
"Exporting {} patches in {} since {}\n".format(num_patches, repo, patch_range[0:7])
|
||||
)
|
||||
sys.stderr.write("Exporting {} patches in {} since {}\n".format(
|
||||
num_patches, repo, patch_range[0:7]))
|
||||
patch_data = format_patch(repo, patch_range)
|
||||
patches = split_patches(patch_data)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from util import SRC_DIR
|
||||
from lib.util import SRC_DIR
|
||||
|
||||
PYYAML_LIB_DIR = os.path.join(SRC_DIR, 'third_party', 'pyyaml', 'lib')
|
||||
sys.path.append(PYYAML_LIB_DIR)
|
||||
|
||||
@@ -29,11 +29,25 @@ const IS_WINDOWS = process.platform === 'win32';
|
||||
|
||||
function spawnAndCheckExitCode (cmd, args, opts) {
|
||||
opts = Object.assign({ stdio: 'inherit' }, opts);
|
||||
const status = childProcess.spawnSync(cmd, args, opts).status;
|
||||
if (status) process.exit(status);
|
||||
const { error, status, signal } = childProcess.spawnSync(cmd, args, opts);
|
||||
if (error) {
|
||||
// the subsprocess failed or timed out
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
}
|
||||
if (status === null) {
|
||||
// the subprocess terminated due to a signal
|
||||
console.error(signal);
|
||||
process.exit(1);
|
||||
}
|
||||
if (status !== 0) {
|
||||
// `status` is an exit code
|
||||
process.exit(status);
|
||||
}
|
||||
}
|
||||
|
||||
function cpplint (args) {
|
||||
args.unshift(`--project_root=${SOURCE_ROOT}`);
|
||||
const result = childProcess.spawnSync(IS_WINDOWS ? 'cpplint.bat' : 'cpplint.py', args, { encoding: 'utf8', shell: true });
|
||||
// cpplint.py writes EVERYTHING to stderr, including status messages
|
||||
if (result.stderr) {
|
||||
@@ -91,7 +105,7 @@ const LINTERS = [{
|
||||
const rcfile = path.join(DEPOT_TOOLS, 'pylintrc');
|
||||
const args = ['--rcfile=' + rcfile, ...filenames];
|
||||
const env = Object.assign({ PYTHONPATH: path.join(SOURCE_ROOT, 'script') }, process.env);
|
||||
spawnAndCheckExitCode('pylint.py', args, { env });
|
||||
spawnAndCheckExitCode('pylint', args, { env });
|
||||
}
|
||||
}, {
|
||||
key: 'javascript',
|
||||
|
||||
@@ -21,6 +21,10 @@
|
||||
"parallel/test-crypto-engine",
|
||||
"parallel/test-crypto-fips",
|
||||
"parallel/test-crypto-hkdf.js",
|
||||
"parallel/test-crypto-keygen",
|
||||
"parallel/test-crypto-keygen-deprecation",
|
||||
"parallel/test-crypto-key-objects",
|
||||
"parallel/test-crypto-padding-aes256",
|
||||
"parallel/test-crypto-secure-heap",
|
||||
"parallel/test-fs-utimes-y2K38",
|
||||
"parallel/test-http2-clean-output",
|
||||
|
||||
@@ -135,7 +135,7 @@ def main():
|
||||
json.load(f) # Make sure it's not an empty file
|
||||
print("Using existing mtime cache for patches")
|
||||
return 0
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
|
||||
@@ -100,7 +100,8 @@ def main():
|
||||
# Upload libcxx_objects.zip for linux only
|
||||
libcxx_objects = get_zip_name('libcxx-objects', ELECTRON_VERSION)
|
||||
libcxx_objects_zip = os.path.join(OUT_DIR, libcxx_objects)
|
||||
shutil.copy2(os.path.join(OUT_DIR, 'libcxx_objects.zip'), libcxx_objects_zip)
|
||||
shutil.copy2(os.path.join(OUT_DIR, 'libcxx_objects.zip'),
|
||||
libcxx_objects_zip)
|
||||
upload_electron(release, libcxx_objects_zip, args)
|
||||
|
||||
# Upload headers.zip and abi_headers.zip as non-platform specific
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
REM Parameters vs_buildtools.exe download link and wsdk version
|
||||
@ECHO OFF
|
||||
|
||||
SET buildtools_link=https://download.visualstudio.microsoft.com/download/pr/d7691cc1-82e6-434f-8e9f-a612f85b4b76/c62179f8cbbb58d4af22c21e8d4e122165f21615f529c94fad5cc7e012f1ef08/vs_BuildTools.exe
|
||||
SET wsdk10_link=https://go.microsoft.com/fwlink/p/?LinkId=845298
|
||||
SET wsdk=10SDK.18362
|
||||
SET wsdk10_link=https://go.microsoft.com/fwlink/?linkid=2120843
|
||||
SET wsdk=10SDK.19041
|
||||
|
||||
REM Check for disk space
|
||||
Rem 543210987654321
|
||||
@@ -44,24 +43,6 @@ IF NOT "%1"=="" (
|
||||
|
||||
if not exist "C:\TEMP\" mkdir C:\TEMP
|
||||
|
||||
REM Download vs_buildtools.exe to C:\TEMP\vs_buildtools.exe
|
||||
powershell -command "& { iwr %buildtools_link% -OutFile C:\TEMP\vs_buildtools.exe }"
|
||||
|
||||
REM Install Visual Studio Toolchain
|
||||
C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache ^
|
||||
--installPath "%ProgramFiles(x86)%/Microsoft Visual Studio/2019/Community" ^
|
||||
--add Microsoft.VisualStudio.Workload.VCTools ^
|
||||
--add Microsoft.VisualStudio.Component.VC.140 ^
|
||||
--add Microsoft.VisualStudio.Component.VC.ATLMFC ^
|
||||
--add Microsoft.VisualStudio.Component.VC.Tools.ARM64 ^
|
||||
--add Microsoft.VisualStudio.Component.VC.MFC.ARM64 ^
|
||||
--add Microsoft.VisualStudio.Component.Windows%wsdk% ^
|
||||
--includeRecommended
|
||||
|
||||
REM Install Windows SDK
|
||||
powershell -command "& { iwr %wsdk10_link% -OutFile C:\TEMP\wsdk10.exe }"
|
||||
C:\TEMP\wsdk10.exe /features /quiet
|
||||
|
||||
REM Install chocolatey to further install dependencies
|
||||
set chocolateyUseWindowsCompression='true'
|
||||
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" ^
|
||||
@@ -69,8 +50,15 @@ set chocolateyUseWindowsCompression='true'
|
||||
-Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
|
||||
SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
|
||||
|
||||
REM Install Visual Studio Toolchain
|
||||
choco install visualstudio2019buildtools --package-parameters "--quiet --wait --norestart --nocache --installPath ""%ProgramFiles(x86)%/Microsoft Visual Studio/2019/Community"" --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.140 --add Microsoft.VisualStudio.Component.VC.ATLMFC --add Microsoft.VisualStudio.Component.VC.Tools.ARM64 --add Microsoft.VisualStudio.Component.VC.MFC.ARM64 --add Microsoft.VisualStudio.Component.Windows%wsdk% --includeRecommended"
|
||||
|
||||
REM Install Windows SDK
|
||||
powershell -command "& { iwr %wsdk10_link% -OutFile C:\TEMP\wsdk10.exe }"
|
||||
C:\TEMP\wsdk10.exe /features /quiet
|
||||
|
||||
REM Install nodejs python git and yarn needed dependencies
|
||||
choco install -y nodejs python2 git yarn windows-sdk-10-version-1903-windbg
|
||||
choco install -y nodejs python2 git yarn choco install windows-sdk-10-version-2004-windbg
|
||||
call C:\ProgramData\chocolatey\bin\RefreshEnv.cmd
|
||||
SET PATH=C:\Python27\;C:\Python27\Scripts;%PATH%
|
||||
|
||||
|
||||
@@ -48,7 +48,8 @@ def main():
|
||||
# FIXME: Enable after ELECTRON_ENABLE_LOGGING works again
|
||||
# env['ELECTRON_ENABLE_LOGGING'] = 'true'
|
||||
testargs = [electron, test_path]
|
||||
if sys.platform != 'linux' and (platform.machine() == 'ARM64' or os.environ.get('TARGET_ARCH') == 'arm64'):
|
||||
if sys.platform != 'linux' and (platform.machine() == 'ARM64' or
|
||||
os.environ.get('TARGET_ARCH') == 'arm64'):
|
||||
testargs.append('--disable-accelerated-video-decode')
|
||||
subprocess.check_call(testargs, env=env)
|
||||
except subprocess.CalledProcessError as e:
|
||||
|
||||
@@ -39,10 +39,7 @@ void BrowserWindow::OverrideNSWindowContentView(
|
||||
|
||||
void BrowserWindow::UpdateDraggableRegions(
|
||||
const std::vector<mojom::DraggableRegionPtr>& regions) {
|
||||
if (window_->has_frame())
|
||||
return;
|
||||
|
||||
if (!web_contents())
|
||||
if (window_->has_frame() || !web_contents())
|
||||
return;
|
||||
|
||||
// All ControlRegionViews should be added as children of the WebContentsView,
|
||||
@@ -78,8 +75,13 @@ void BrowserWindow::UpdateDraggableRegions(
|
||||
DraggableRegionsToSkRegion(regions), webViewWidth, webViewHeight);
|
||||
}
|
||||
|
||||
// Draggable regions on BrowserViews are independent from those of
|
||||
// BrowserWindows, so if a BrowserView with different draggable regions than
|
||||
// the BrowserWindow it belongs to is superimposed on top of that window, the
|
||||
// draggable regions of the BrowserView take precedence over those of the
|
||||
// BrowserWindow.
|
||||
for (NativeBrowserView* view : window_->browser_views()) {
|
||||
view->UpdateDraggableRegions(drag_exclude_rects);
|
||||
view->UpdateDraggableRegions(view->GetDraggableRegions());
|
||||
}
|
||||
|
||||
// Create and add a ControlRegionView for each region that needs to be
|
||||
|
||||
@@ -236,13 +236,11 @@ std::u16string Menu::GetToolTipAt(int index) const {
|
||||
return model_->GetToolTipAt(index);
|
||||
}
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
std::u16string Menu::GetAcceleratorTextAtForTesting(int index) const {
|
||||
ui::Accelerator accelerator;
|
||||
model_->GetAcceleratorAtWithParams(index, true, &accelerator);
|
||||
return accelerator.GetShortcutText();
|
||||
}
|
||||
#endif
|
||||
|
||||
bool Menu::IsItemCheckedAt(int index) const {
|
||||
return model_->IsItemCheckedAt(index);
|
||||
@@ -297,9 +295,7 @@ v8::Local<v8::ObjectTemplate> Menu::FillObjectTemplate(
|
||||
.SetMethod("isVisibleAt", &Menu::IsVisibleAt)
|
||||
.SetMethod("popupAt", &Menu::PopupAt)
|
||||
.SetMethod("closePopupAt", &Menu::ClosePopupAt)
|
||||
#if DCHECK_IS_ON()
|
||||
.SetMethod("getAcceleratorTextAt", &Menu::GetAcceleratorTextAtForTesting)
|
||||
#endif
|
||||
.SetMethod("_getAcceleratorTextAt", &Menu::GetAcceleratorTextAtForTesting)
|
||||
#if defined(OS_MAC)
|
||||
.SetMethod("_getUserAcceleratorAt", &Menu::GetUserAcceleratorAt)
|
||||
#endif
|
||||
|
||||
@@ -79,9 +79,7 @@ class Menu : public gin::Wrappable<Menu>,
|
||||
int positioning_item,
|
||||
base::OnceClosure callback) = 0;
|
||||
virtual void ClosePopupAt(int32_t window_id) = 0;
|
||||
#if DCHECK_IS_ON()
|
||||
virtual std::u16string GetAcceleratorTextAtForTesting(int index) const;
|
||||
#endif
|
||||
|
||||
std::unique_ptr<ElectronMenuModel> model_;
|
||||
Menu* parent_ = nullptr;
|
||||
|
||||
@@ -34,9 +34,7 @@ class MenuMac : public Menu {
|
||||
int positioning_item,
|
||||
base::OnceClosure callback);
|
||||
void ClosePopupAt(int32_t window_id) override;
|
||||
#if DCHECK_IS_ON()
|
||||
std::u16string GetAcceleratorTextAtForTesting(int index) const override;
|
||||
#endif
|
||||
|
||||
private:
|
||||
friend class Menu;
|
||||
|
||||
@@ -170,7 +170,6 @@ void MenuMac::ClosePopupAt(int32_t window_id) {
|
||||
std::move(close_popup));
|
||||
}
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
std::u16string MenuMac::GetAcceleratorTextAtForTesting(int index) const {
|
||||
// A least effort to get the real shortcut text of NSMenuItem, the code does
|
||||
// not need to be perfect since it is test only.
|
||||
@@ -206,7 +205,6 @@ std::u16string MenuMac::GetAcceleratorTextAtForTesting(int index) const {
|
||||
text += key;
|
||||
return text;
|
||||
}
|
||||
#endif
|
||||
|
||||
void MenuMac::ClosePopupOnUI(int32_t window_id) {
|
||||
auto controller = popup_controllers_.find(window_id);
|
||||
|
||||
@@ -953,18 +953,31 @@ WebContents::~WebContents() {
|
||||
// InspectableWebContents will be automatically destroyed.
|
||||
}
|
||||
|
||||
void WebContents::DeleteThisIfAlive() {
|
||||
// It is possible that the FirstWeakCallback has been called but the
|
||||
// SecondWeakCallback has not, in this case the garbage collection of
|
||||
// WebContents has already started and we should not |delete this|.
|
||||
// Calling |GetWrapper| can detect this corner case.
|
||||
auto* isolate = JavascriptEnvironment::GetIsolate();
|
||||
v8::HandleScope scope(isolate);
|
||||
v8::Local<v8::Object> wrapper;
|
||||
if (!GetWrapper(isolate).ToLocal(&wrapper))
|
||||
return;
|
||||
delete this;
|
||||
}
|
||||
|
||||
void WebContents::Destroy() {
|
||||
// The content::WebContents should be destroyed asyncronously when possible
|
||||
// as user may choose to destroy WebContents during an event of it.
|
||||
if (Browser::Get()->is_shutting_down() || IsGuest() ||
|
||||
type_ == Type::kBrowserView) {
|
||||
delete this;
|
||||
DeleteThisIfAlive();
|
||||
} else {
|
||||
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
|
||||
base::BindOnce(
|
||||
[](base::WeakPtr<WebContents> contents) {
|
||||
if (contents)
|
||||
delete contents.get();
|
||||
contents->DeleteThisIfAlive();
|
||||
},
|
||||
GetWeakPtr()));
|
||||
}
|
||||
|
||||
@@ -451,6 +451,9 @@ class WebContents : public gin::Wrappable<WebContents>,
|
||||
WebContents(v8::Isolate* isolate, const gin_helper::Dictionary& options);
|
||||
~WebContents() override;
|
||||
|
||||
// Delete this if garbage collection has not started.
|
||||
void DeleteThisIfAlive();
|
||||
|
||||
// Creates a InspectableWebContents object and takes ownership of
|
||||
// |web_contents|.
|
||||
void InitWithWebContents(std::unique_ptr<content::WebContents> web_contents,
|
||||
|
||||
@@ -99,10 +99,8 @@ inline void dispatch_sync_main(dispatch_block_t block) {
|
||||
}
|
||||
|
||||
- (void)resignCurrentActivity {
|
||||
if (@available(macOS 10.11, *)) {
|
||||
if (currentActivity_)
|
||||
[currentActivity_ resignCurrent];
|
||||
}
|
||||
if (currentActivity_)
|
||||
[currentActivity_ resignCurrent];
|
||||
}
|
||||
|
||||
- (void)updateCurrentActivity:(NSString*)type
|
||||
|
||||
@@ -59,7 +59,8 @@ const NSAutoresizingMaskOptions kDefaultAutoResizingMask =
|
||||
}
|
||||
|
||||
- (BOOL)mouseDownCanMoveWindow {
|
||||
return NO;
|
||||
return
|
||||
[self.window respondsToSelector:@selector(performWindowDragWithEvent:)];
|
||||
}
|
||||
|
||||
- (BOOL)acceptsFirstMouse:(NSEvent*)event {
|
||||
@@ -85,16 +86,15 @@ const NSAutoresizingMaskOptions kDefaultAutoResizingMask =
|
||||
- (void)mouseDown:(NSEvent*)event {
|
||||
[super mouseDown:event];
|
||||
|
||||
if ([self.window respondsToSelector:@selector(performWindowDragWithEvent)]) {
|
||||
if ([self.window respondsToSelector:@selector(performWindowDragWithEvent:)]) {
|
||||
// According to Google, using performWindowDragWithEvent:
|
||||
// does not generate a NSWindowWillMoveNotification. Hence post one.
|
||||
[[NSNotificationCenter defaultCenter]
|
||||
postNotificationName:NSWindowWillMoveNotification
|
||||
object:self];
|
||||
|
||||
if (@available(macOS 10.11, *)) {
|
||||
[self.window performWindowDragWithEvent:event];
|
||||
}
|
||||
[self.window performWindowDragWithEvent:event];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ const NSAutoresizingMaskOptions kDefaultAutoResizingMask =
|
||||
}
|
||||
|
||||
- (void)mouseDragged:(NSEvent*)event {
|
||||
if ([self.window respondsToSelector:@selector(performWindowDragWithEvent)]) {
|
||||
if ([self.window respondsToSelector:@selector(performWindowDragWithEvent:)]) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1408,24 +1408,21 @@ void NativeWindowMac::SetVibrancy(const std::string& type) {
|
||||
vibrancyType = NSVisualEffectMaterialTitlebar;
|
||||
}
|
||||
|
||||
if (@available(macOS 10.11, *)) {
|
||||
if (type == "selection") {
|
||||
vibrancyType = NSVisualEffectMaterialSelection;
|
||||
} else if (type == "menu") {
|
||||
vibrancyType = NSVisualEffectMaterialMenu;
|
||||
} else if (type == "popover") {
|
||||
vibrancyType = NSVisualEffectMaterialPopover;
|
||||
} else if (type == "sidebar") {
|
||||
vibrancyType = NSVisualEffectMaterialSidebar;
|
||||
} else if (type == "medium-light") {
|
||||
EmitWarning(env, "NSVisualEffectMaterialMediumLight" + dep_warn,
|
||||
"electron");
|
||||
vibrancyType = NSVisualEffectMaterialMediumLight;
|
||||
} else if (type == "ultra-dark") {
|
||||
EmitWarning(env, "NSVisualEffectMaterialUltraDark" + dep_warn,
|
||||
"electron");
|
||||
vibrancyType = NSVisualEffectMaterialUltraDark;
|
||||
}
|
||||
if (type == "selection") {
|
||||
vibrancyType = NSVisualEffectMaterialSelection;
|
||||
} else if (type == "menu") {
|
||||
vibrancyType = NSVisualEffectMaterialMenu;
|
||||
} else if (type == "popover") {
|
||||
vibrancyType = NSVisualEffectMaterialPopover;
|
||||
} else if (type == "sidebar") {
|
||||
vibrancyType = NSVisualEffectMaterialSidebar;
|
||||
} else if (type == "medium-light") {
|
||||
EmitWarning(env, "NSVisualEffectMaterialMediumLight" + dep_warn,
|
||||
"electron");
|
||||
vibrancyType = NSVisualEffectMaterialMediumLight;
|
||||
} else if (type == "ultra-dark") {
|
||||
EmitWarning(env, "NSVisualEffectMaterialUltraDark" + dep_warn, "electron");
|
||||
vibrancyType = NSVisualEffectMaterialUltraDark;
|
||||
}
|
||||
|
||||
if (@available(macOS 10.14, *)) {
|
||||
|
||||
@@ -50,8 +50,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 17,0,0,20210924
|
||||
PRODUCTVERSION 17,0,0,20210924
|
||||
FILEVERSION 17,0,0,20210930
|
||||
PRODUCTVERSION 17,0,0,20210930
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
||||
@@ -125,16 +125,13 @@
|
||||
range:NSMakeRange(0, [attributed_title length])];
|
||||
}
|
||||
} else if ([font_type isEqualToString:@"monospacedDigit"]) {
|
||||
if (@available(macOS 10.11, *)) {
|
||||
NSDictionary* attributes = @{
|
||||
NSFontAttributeName :
|
||||
[NSFont monospacedDigitSystemFontOfSize:existing_size
|
||||
weight:NSFontWeightRegular]
|
||||
};
|
||||
[attributed_title
|
||||
addAttributes:attributes
|
||||
range:NSMakeRange(0, [attributed_title length])];
|
||||
}
|
||||
NSDictionary* attributes = @{
|
||||
NSFontAttributeName :
|
||||
[NSFont monospacedDigitSystemFontOfSize:existing_size
|
||||
weight:NSFontWeightRegular]
|
||||
};
|
||||
[attributed_title addAttributes:attributes
|
||||
range:NSMakeRange(0, [attributed_title length])];
|
||||
}
|
||||
|
||||
// Set title
|
||||
|
||||
@@ -106,28 +106,6 @@ bool IsSameOrigin(const GURL& l, const GURL& r) {
|
||||
return url::Origin::Create(l).IsSameOriginWith(url::Origin::Create(r));
|
||||
}
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
std::vector<v8::Global<v8::Value>> weakly_tracked_values;
|
||||
|
||||
void WeaklyTrackValue(v8::Isolate* isolate, v8::Local<v8::Value> value) {
|
||||
v8::Global<v8::Value> global_value(isolate, value);
|
||||
global_value.SetWeak();
|
||||
weakly_tracked_values.push_back(std::move(global_value));
|
||||
}
|
||||
|
||||
void ClearWeaklyTrackedValues() {
|
||||
weakly_tracked_values.clear();
|
||||
}
|
||||
|
||||
std::vector<v8::Local<v8::Value>> GetWeaklyTrackedValues(v8::Isolate* isolate) {
|
||||
std::vector<v8::Local<v8::Value>> locals;
|
||||
for (const auto& value : weakly_tracked_values) {
|
||||
if (!value.IsEmpty())
|
||||
locals.push_back(value.Get(isolate));
|
||||
}
|
||||
return locals;
|
||||
}
|
||||
|
||||
// This causes a fatal error by creating a circular extension dependency.
|
||||
void TriggerFatalErrorForTesting(v8::Isolate* isolate) {
|
||||
static const char* aDeps[] = {"B"};
|
||||
@@ -141,7 +119,6 @@ void TriggerFatalErrorForTesting(v8::Isolate* isolate) {
|
||||
void RunUntilIdle() {
|
||||
base::RunLoop().RunUntilIdle();
|
||||
}
|
||||
#endif
|
||||
|
||||
void Initialize(v8::Local<v8::Object> exports,
|
||||
v8::Local<v8::Value> unused,
|
||||
@@ -156,13 +133,8 @@ void Initialize(v8::Local<v8::Object> exports,
|
||||
dict.SetMethod("requestGarbageCollectionForTesting",
|
||||
&RequestGarbageCollectionForTesting);
|
||||
dict.SetMethod("isSameOrigin", &IsSameOrigin);
|
||||
#if DCHECK_IS_ON()
|
||||
dict.SetMethod("triggerFatalErrorForTesting", &TriggerFatalErrorForTesting);
|
||||
dict.SetMethod("getWeaklyTrackedValues", &GetWeaklyTrackedValues);
|
||||
dict.SetMethod("clearWeaklyTrackedValues", &ClearWeaklyTrackedValues);
|
||||
dict.SetMethod("weaklyTrackValue", &WeaklyTrackValue);
|
||||
dict.SetMethod("runUntilIdle", &RunUntilIdle);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -615,11 +615,11 @@ describe('contextBridge', () => {
|
||||
if (!useSandbox) {
|
||||
it('should release the global hold on methods sent across contexts', async () => {
|
||||
await makeBindingWindow(() => {
|
||||
require('electron').ipcRenderer.on('get-gc-info', (e: Electron.IpcRendererEvent) => e.sender.send('gc-info', { trackedValues: process._linkedBinding('electron_common_v8_util').getWeaklyTrackedValues().length }));
|
||||
const { weaklyTrackValue } = process._linkedBinding('electron_common_v8_util');
|
||||
const trackedValues: WeakRef<object>[] = [];
|
||||
require('electron').ipcRenderer.on('get-gc-info', e => e.sender.send('gc-info', { trackedValues: trackedValues.filter(value => value.deref()).length }));
|
||||
contextBridge.exposeInMainWorld('example', {
|
||||
getFunction: () => () => 123,
|
||||
track: weaklyTrackValue
|
||||
track: (value: object) => { trackedValues.push(new WeakRef(value)); }
|
||||
});
|
||||
});
|
||||
await callWithBindings(async (root: any) => {
|
||||
@@ -643,11 +643,11 @@ describe('contextBridge', () => {
|
||||
if (useSandbox) {
|
||||
it('should not leak the global hold on methods sent across contexts when reloading a sandboxed renderer', async () => {
|
||||
await makeBindingWindow(() => {
|
||||
require('electron').ipcRenderer.on('get-gc-info', e => e.sender.send('gc-info', { trackedValues: process._linkedBinding('electron_common_v8_util').getWeaklyTrackedValues().length }));
|
||||
const { weaklyTrackValue } = process._linkedBinding('electron_common_v8_util');
|
||||
const trackedValues: WeakRef<object>[] = [];
|
||||
require('electron').ipcRenderer.on('get-gc-info', e => e.sender.send('gc-info', { trackedValues: trackedValues.filter(value => value.deref()).length }));
|
||||
contextBridge.exposeInMainWorld('example', {
|
||||
getFunction: () => () => 123,
|
||||
track: weaklyTrackValue
|
||||
track: (value: object) => { trackedValues.push(new WeakRef(value)); }
|
||||
});
|
||||
require('electron').ipcRenderer.send('window-ready-for-tasking');
|
||||
});
|
||||
|
||||
@@ -462,9 +462,9 @@ describe('MenuItems', () => {
|
||||
{ label: 'text', accelerator: 'Alt+A' }
|
||||
]);
|
||||
|
||||
expect(menu.getAcceleratorTextAt(0)).to.equal(isDarwin() ? 'Command+A' : 'Ctrl+A');
|
||||
expect(menu.getAcceleratorTextAt(1)).to.equal('Shift+A');
|
||||
expect(menu.getAcceleratorTextAt(2)).to.equal('Alt+A');
|
||||
expect(menu._getAcceleratorTextAt(0)).to.equal(isDarwin() ? 'Command+A' : 'Ctrl+A');
|
||||
expect(menu._getAcceleratorTextAt(1)).to.equal('Shift+A');
|
||||
expect(menu._getAcceleratorTextAt(2)).to.equal('Alt+A');
|
||||
});
|
||||
|
||||
it('should display modifiers correctly for special keys', () => {
|
||||
@@ -474,9 +474,9 @@ describe('MenuItems', () => {
|
||||
{ label: 'text', accelerator: 'Alt+Tab' }
|
||||
]);
|
||||
|
||||
expect(menu.getAcceleratorTextAt(0)).to.equal(isDarwin() ? 'Command+Tab' : 'Ctrl+Tab');
|
||||
expect(menu.getAcceleratorTextAt(1)).to.equal('Shift+Tab');
|
||||
expect(menu.getAcceleratorTextAt(2)).to.equal('Alt+Tab');
|
||||
expect(menu._getAcceleratorTextAt(0)).to.equal(isDarwin() ? 'Command+Tab' : 'Ctrl+Tab');
|
||||
expect(menu._getAcceleratorTextAt(1)).to.equal('Shift+Tab');
|
||||
expect(menu._getAcceleratorTextAt(2)).to.equal('Alt+Tab');
|
||||
});
|
||||
|
||||
it('should not display modifiers twice', () => {
|
||||
@@ -485,8 +485,8 @@ describe('MenuItems', () => {
|
||||
{ label: 'text', accelerator: 'Shift+Shift+Tab' }
|
||||
]);
|
||||
|
||||
expect(menu.getAcceleratorTextAt(0)).to.equal('Shift+A');
|
||||
expect(menu.getAcceleratorTextAt(1)).to.equal('Shift+Tab');
|
||||
expect(menu._getAcceleratorTextAt(0)).to.equal('Shift+A');
|
||||
expect(menu._getAcceleratorTextAt(1)).to.equal('Shift+Tab');
|
||||
});
|
||||
|
||||
it('should display correctly for shifted keys', () => {
|
||||
@@ -499,12 +499,12 @@ describe('MenuItems', () => {
|
||||
{ label: 'text', accelerator: 'Control+?' }
|
||||
]);
|
||||
|
||||
expect(menu.getAcceleratorTextAt(0)).to.equal('Ctrl+Shift+=');
|
||||
expect(menu.getAcceleratorTextAt(1)).to.equal('Ctrl++');
|
||||
expect(menu.getAcceleratorTextAt(2)).to.equal('Ctrl+Shift+3');
|
||||
expect(menu.getAcceleratorTextAt(3)).to.equal('Ctrl+#');
|
||||
expect(menu.getAcceleratorTextAt(4)).to.equal('Ctrl+Shift+/');
|
||||
expect(menu.getAcceleratorTextAt(5)).to.equal('Ctrl+?');
|
||||
expect(menu._getAcceleratorTextAt(0)).to.equal('Ctrl+Shift+=');
|
||||
expect(menu._getAcceleratorTextAt(1)).to.equal('Ctrl++');
|
||||
expect(menu._getAcceleratorTextAt(2)).to.equal('Ctrl+Shift+3');
|
||||
expect(menu._getAcceleratorTextAt(3)).to.equal('Ctrl+#');
|
||||
expect(menu._getAcceleratorTextAt(4)).to.equal('Ctrl+Shift+/');
|
||||
expect(menu._getAcceleratorTextAt(5)).to.equal('Ctrl+?');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -317,6 +317,21 @@ describe('node feature', () => {
|
||||
// eslint-disable-next-line no-octal
|
||||
crypto.createDiffieHellman('abc', '123');
|
||||
});
|
||||
|
||||
it('does not crash when calling crypto.createPrivateKey() with an unsupported algorithm', () => {
|
||||
const crypto = require('crypto');
|
||||
|
||||
const ed448 = {
|
||||
crv: 'Ed448',
|
||||
x: 'KYWcaDwgH77xdAwcbzOgvCVcGMy9I6prRQBhQTTdKXUcr-VquTz7Fd5adJO0wT2VHysF3bk3kBoA',
|
||||
d: 'UhC3-vN5vp_g9PnTknXZgfXUez7Xvw-OfuJ0pYkuwzpYkcTvacqoFkV_O05WMHpyXkzH9q2wzx5n',
|
||||
kty: 'OKP'
|
||||
};
|
||||
|
||||
expect(() => {
|
||||
crypto.createPrivateKey({ key: ed448, format: 'jwk' });
|
||||
}).to.throw(/Failed to create key - unsupported algorithm/);
|
||||
});
|
||||
});
|
||||
|
||||
describe('process.stdout', () => {
|
||||
|
||||
3
typings/internal-ambient.d.ts
vendored
3
typings/internal-ambient.d.ts
vendored
@@ -44,9 +44,6 @@ declare namespace NodeJS {
|
||||
setHiddenValue<T>(obj: any, key: string, value: T): void;
|
||||
deleteHiddenValue(obj: any, key: string): void;
|
||||
requestGarbageCollectionForTesting(): void;
|
||||
weaklyTrackValue(value: any): void;
|
||||
clearWeaklyTrackedValues(): void;
|
||||
getWeaklyTrackedValues(): any[];
|
||||
runUntilIdle(): void;
|
||||
isSameOrigin(a: string, b: string): boolean;
|
||||
triggerFatalErrorForTesting(): void;
|
||||
|
||||
2
typings/internal-electron.d.ts
vendored
2
typings/internal-electron.d.ts
vendored
@@ -123,7 +123,7 @@ declare namespace Electron {
|
||||
insertSeparator(index: number): void;
|
||||
insertSubMenu(index: number, commandId: number, label: string, submenu?: Menu): void;
|
||||
delegate?: any;
|
||||
getAcceleratorTextAt(index: number): string;
|
||||
_getAcceleratorTextAt(index: number): string;
|
||||
}
|
||||
|
||||
interface MenuItem {
|
||||
|
||||
Reference in New Issue
Block a user