Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,16 @@ def configure_v8(o, configs):
o['variables']['v8_enable_webassembly'] = 0 if options.v8_lite_mode else 1
o['variables']['v8_enable_javascript_promise_hooks'] = 1
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0
is_gdbjit_supported_arch = (
'x64' in o['variables']['target_arch'] or
'ia32' in o['variables']['target_arch'] or
'ppc64' in o['variables']['target_arch']
)
is_linux = flavor == 'linux'
if (options.gdb is not None):
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0
else:
o['variables']['v8_enable_gdbjit'] = 1 if is_gdbjit_supported_arch and is_linux else 0
o['variables']['v8_optimized_debug'] = 0 if options.v8_non_optimized_debug else 1
o['variables']['dcheck_always_on'] = 1 if options.v8_with_dchecks else 0
o['variables']['v8_enable_object_print'] = 0 if options.v8_disable_object_print else 1
Expand Down
4 changes: 2 additions & 2 deletions deps/googletest/include/gtest/internal/gtest-port.h
Original file line number Diff line number Diff line change
Expand Up @@ -1515,13 +1515,13 @@ class [[nodiscard]] ThreadWithParam : public ThreadWithParamBase {

ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
: ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) {}
~ThreadWithParam() override {}
~ThreadWithParam() override = default;

private:
class RunnableImpl : public Runnable {
public:
RunnableImpl(UserThreadFunc* func, T param) : func_(func), param_(param) {}
~RunnableImpl() override {}
~RunnableImpl() override = default;
void Run() override { func_(param_); }

private:
Expand Down
13 changes: 7 additions & 6 deletions deps/googletest/src/gtest-port.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@

#include "gtest/gtest-message.h"
#include "gtest/gtest-spi.h"
#include "gtest/gtest.h"
#include "gtest/internal/gtest-internal.h"
#include "gtest/internal/gtest-string.h"
#include "src/gtest-internal-inl.h"
Expand Down Expand Up @@ -729,7 +730,7 @@ void RE::Init(const char* regex) {
char* const full_pattern = new char[full_regex_len];

snprintf(full_pattern, full_regex_len, "^(%s)$", regex);
is_valid_ = regcomp(&full_regex_, full_pattern, reg_flags) == 0;
int error = regcomp(&full_regex_, full_pattern, reg_flags);
// We want to call regcomp(&partial_regex_, ...) even if the
// previous expression returns false. Otherwise partial_regex_ may
// not be properly initialized can may cause trouble when it's
Expand All @@ -738,13 +739,13 @@ void RE::Init(const char* regex) {
// Some implementation of POSIX regex (e.g. on at least some
// versions of Cygwin) doesn't accept the empty string as a valid
// regex. We change it to an equivalent form "()" to be safe.
if (is_valid_) {
if (!error) {
const char* const partial_regex = (*regex == '\0') ? "()" : regex;
is_valid_ = regcomp(&partial_regex_, partial_regex, reg_flags) == 0;
error = regcomp(&partial_regex_, partial_regex, reg_flags);
}
EXPECT_TRUE(is_valid_)
<< "Regular expression \"" << regex
<< "\" is not a valid POSIX Extended regular expression.";
is_valid_ = error == 0;
EXPECT_EQ(error, 0) << "Regular expression \"" << regex
<< "\" is not a valid POSIX Extended regular expression.";

delete[] full_pattern;
}
Expand Down
4 changes: 2 additions & 2 deletions doc/api/report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

<!-- type=misc -->

> Stability: 2 - Stable

<!-- name=report -->

<!-- YAML
Expand All @@ -22,6 +20,8 @@ changes:
description: Added `--report-exclude-network` option for excluding networking operations that can slow down report generation in some cases.
-->

> Stability: 2 - Stable

Delivers a JSON-formatted diagnostic summary, written to a file.

The report is intended for development, test, and production use, to capture
Expand Down
4 changes: 2 additions & 2 deletions doc/api/synopsis.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Usage and example

## Usage

<!--introduced_in=v0.10.0-->

<!--type=misc-->

## Usage

`node [options] [V8 options] [script.js | -e "script" | - ] [arguments]`

Please see the [Command-line options][] document for more information.
Expand Down
2 changes: 1 addition & 1 deletion src/node_sea_bin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ ExitCode BuildSingleExecutable(const std::string& sea_config_path,

SeaConfig config = opt_config.value();
if (config.executable_path.empty()) {
config.executable_path = args[0];
config.executable_path = Environment::GetExecPath(args);
}

// Get file permissions from source executable to copy over later.
Expand Down
3 changes: 2 additions & 1 deletion test/doctool/test-doc-api-json.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ for await (const dirent of await fs.opendir(new URL('../../out/doc/api/', import
'n-api.md': ['introduced_in', 'stability', 'stabilityText', 'miscs'],
'packages.md': ['introduced_in', 'meta', 'miscs'],
'process.md': ['globals'],
'report.md': ['introduced_in', 'stability', 'stabilityText', 'meta', 'miscs'],
'report.md': ['introduced_in', 'meta', 'stability', 'stabilityText', 'miscs'],
'synopsis.md': ['introduced_in', 'miscs'],
}[dirent.name] ?? ['modules'])]);

assert.partialDeepStrictEqual(allExpectedKeys, findAllKeys(json));
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Last update:
- resource-timing: https://github.com/web-platform-tests/wpt/tree/22d38586d0/resource-timing
- resources: https://github.com/web-platform-tests/wpt/tree/1d2c5fb36a/resources
- streams: https://github.com/web-platform-tests/wpt/tree/bc9dcbbf1a/streams
- url: https://github.com/web-platform-tests/wpt/tree/e3c46fdf55/url
- url: https://github.com/web-platform-tests/wpt/tree/efb889eb4c/url
- urlpattern: https://github.com/web-platform-tests/wpt/tree/a2e15ad405/urlpattern
- user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi
- wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi
- web-locks: https://github.com/web-platform-tests/wpt/tree/10a122a6bc/web-locks
- WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/1e4933113d/WebCryptoAPI
- WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/7cbe7e8ed9/WebCryptoAPI
- webidl: https://github.com/web-platform-tests/wpt/tree/63ca529a02/webidl
- webidl/ecmascript-binding/es-exceptions: https://github.com/web-platform-tests/wpt/tree/2f96fa1996/webidl/ecmascript-binding/es-exceptions
- webmessaging/broadcastchannel: https://github.com/web-platform-tests/wpt/tree/6495c91853/webmessaging/broadcastchannel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
raw: new Uint8Array([4, 1, 86, 244, 121, 248, 223, 30, 32, 167, 255, 192, 76, 228, 32, 195, 225, 84, 174, 37, 25, 150, 190, 228, 47, 3, 75, 132, 212, 27, 116, 63, 52, 228, 95, 49, 27, 129, 58, 156, 222, 200, 205, 165, 155, 187, 189, 49, 212, 96, 179, 41, 37, 33, 231, 193, 183, 34, 229, 102, 124, 3, 219, 47, 174, 117, 63, 1, 80, 23, 54, 207, 226, 71, 57, 67, 32, 216, 228, 175, 194, 253, 57, 181, 169, 51, 16, 97, 184, 30, 34, 65, 40, 43, 158, 23, 137, 24, 34, 181, 183, 158, 5, 47, 69, 151, 181, 150, 67, 253, 57, 55, 156, 81, 189, 81, 37, 196, 244, 139, 195, 240, 37, 206, 60, 211, 105, 83, 40, 108, 203, 56, 251]),
raw_compressed: new Uint8Array([3, 1, 86, 244, 121, 248, 223, 30, 32, 167, 255, 192, 76, 228, 32, 195, 225, 84, 174, 37, 25, 150, 190, 228, 47, 3, 75, 132, 212, 27, 116, 63, 52, 228, 95, 49, 27, 129, 58, 156, 222, 200, 205, 165, 155, 187, 189, 49, 212, 96, 179, 41, 37, 33, 231, 193, 183, 34, 229, 102, 124, 3, 219, 47, 174, 117, 63]),
pkcs8: new Uint8Array([48, 129, 238, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 35, 4, 129, 214, 48, 129, 211, 2, 1, 1, 4, 66, 0, 244, 8, 117, 131, 104, 186, 147, 15, 48, 247, 106, 224, 84, 254, 92, 210, 206, 127, 218, 44, 159, 118, 166, 212, 54, 207, 117, 214, 108, 68, 11, 254, 99, 49, 199, 193, 114, 161, 36, 120, 25, 60, 130, 81, 72, 123, 201, 18, 99, 250, 80, 33, 127, 133, 255, 99, 111, 89, 205, 84, 110, 58, 180, 131, 180, 161, 129, 137, 3, 129, 134, 0, 4, 1, 86, 244, 121, 248, 223, 30, 32, 167, 255, 192, 76, 228, 32, 195, 225, 84, 174, 37, 25, 150, 190, 228, 47, 3, 75, 132, 212, 27, 116, 63, 52, 228, 95, 49, 27, 129, 58, 156, 222, 200, 205, 165, 155, 187, 189, 49, 212, 96, 179, 41, 37, 33, 231, 193, 183, 34, 229, 102, 124, 3, 219, 47, 174, 117, 63, 1, 80, 23, 54, 207, 226, 71, 57, 67, 32, 216, 228, 175, 194, 253, 57, 181, 169, 51, 16, 97, 184, 30, 34, 65, 40, 43, 158, 23, 137, 24, 34, 181, 183, 158, 5, 47, 69, 151, 181, 150, 67, 253, 57, 55, 156, 81, 189, 81, 37, 196, 244, 139, 195, 240, 37, 206, 60, 211, 105, 83, 40, 108, 203, 56, 251]),
pkcs8_private_only: new Uint8Array([48, 96, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 35, 4, 73, 48, 71, 2, 1, 1, 4, 66, 0, 244, 8, 117, 131, 104, 186, 147, 15, 48, 247, 106, 224, 84, 254, 92, 210, 206, 127, 218, 44, 159, 118, 166, 212, 54, 207, 117, 214, 108, 68, 11, 254, 99, 49, 199, 193, 114, 161, 36, 120, 25, 60, 130, 81, 72, 123, 201, 18, 99, 250, 80, 33, 127, 133, 255, 99, 111, 89, 205, 84, 110, 58, 180, 131, 180]),
jwk: {
kty: "EC",
crv: "P-521",
Expand All @@ -31,6 +32,7 @@
raw: new Uint8Array([4, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209, 206, 3, 117, 82, 212, 129, 69, 12, 227, 155, 77, 16, 149, 112, 27, 23, 91, 250, 179, 75, 142, 108, 9, 158, 24, 241, 193, 152, 53, 131, 97, 232]),
raw_compressed: new Uint8Array([2, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209]),
pkcs8: new Uint8Array([48, 129, 135, 2, 1, 0, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 4, 109, 48, 107, 2, 1, 1, 4, 32, 19, 211, 58, 45, 90, 191, 156, 249, 235, 178, 31, 248, 96, 212, 174, 254, 110, 86, 231, 119, 144, 244, 222, 233, 180, 8, 132, 235, 211, 53, 68, 234, 161, 68, 3, 66, 0, 4, 210, 16, 176, 166, 249, 217, 240, 18, 134, 128, 88, 180, 63, 164, 244, 113, 1, 133, 67, 187, 160, 12, 146, 80, 223, 146, 87, 194, 172, 174, 93, 209, 206, 3, 117, 82, 212, 129, 69, 12, 227, 155, 77, 16, 149, 112, 27, 23, 91, 250, 179, 75, 142, 108, 9, 158, 24, 241, 193, 152, 53, 131, 97, 232]),
pkcs8_private_only: new Uint8Array([48, 65, 2, 1, 0, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 4, 39, 48, 37, 2, 1, 1, 4, 32, 19, 211, 58, 45, 90, 191, 156, 249, 235, 178, 31, 248, 96, 212, 174, 254, 110, 86, 231, 119, 144, 244, 222, 233, 180, 8, 132, 235, 211, 53, 68, 234]),
jwk: {
kty: "EC",
crv: "P-256",
Expand All @@ -46,6 +48,7 @@
raw: new Uint8Array([4, 33, 156, 20, 214, 102, 23, 179, 110, 198, 216, 133, 107, 56, 91, 115, 167, 77, 52, 79, 216, 174, 117, 239, 4, 100, 53, 221, 165, 78, 59, 68, 189, 95, 189, 235, 209, 208, 141, 214, 158, 45, 125, 193, 220, 33, 140, 180, 53, 189, 40, 19, 140, 199, 120, 51, 122, 132, 47, 107, 214, 27, 36, 14, 116, 36, 159, 36, 102, 124, 42, 88, 16, 167, 107, 252, 40, 224, 51, 95, 136, 166, 80, 29, 236, 1, 151, 109, 168, 90, 251, 0, 134, 156, 182, 172, 232]),
raw_compressed: new Uint8Array([2, 33, 156, 20, 214, 102, 23, 179, 110, 198, 216, 133, 107, 56, 91, 115, 167, 77, 52, 79, 216, 174, 117, 239, 4, 100, 53, 221, 165, 78, 59, 68, 189, 95, 189, 235, 209, 208, 141, 214, 158, 45, 125, 193, 220, 33, 140, 180, 53]),
pkcs8: new Uint8Array([48, 129, 182, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 4, 129, 158, 48, 129, 155, 2, 1, 1, 4, 48, 69, 55, 181, 153, 7, 132, 211, 194, 210, 46, 150, 168, 249, 47, 161, 170, 73, 46, 232, 115, 229, 118, 164, 21, 130, 225, 68, 24, 60, 152, 136, 209, 14, 107, 158, 180, 206, 212, 178, 204, 64, 18, 228, 172, 94, 168, 64, 115, 161, 100, 3, 98, 0, 4, 33, 156, 20, 214, 102, 23, 179, 110, 198, 216, 133, 107, 56, 91, 115, 167, 77, 52, 79, 216, 174, 117, 239, 4, 100, 53, 221, 165, 78, 59, 68, 189, 95, 189, 235, 209, 208, 141, 214, 158, 45, 125, 193, 220, 33, 140, 180, 53, 189, 40, 19, 140, 199, 120, 51, 122, 132, 47, 107, 214, 27, 36, 14, 116, 36, 159, 36, 102, 124, 42, 88, 16, 167, 107, 252, 40, 224, 51, 95, 136, 166, 80, 29, 236, 1, 151, 109, 168, 90, 251, 0, 134, 156, 182, 172, 232]),
pkcs8_private_only: new Uint8Array([48, 78, 2, 1, 0, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, 6, 5, 43, 129, 4, 0, 34, 4, 55, 48, 53, 2, 1, 1, 4, 48, 69, 55, 181, 153, 7, 132, 211, 194, 210, 46, 150, 168, 249, 47, 161, 170, 73, 46, 232, 115, 229, 118, 164, 21, 130, 225, 68, 24, 60, 152, 136, 209, 14, 107, 158, 180, 206, 212, 178, 204, 64, 18, 228, 172, 94, 168, 64, 115]),
jwk: {
kty: "EC",
crv: "P-384",
Expand Down Expand Up @@ -100,6 +103,14 @@
testEmptyUsages(format, algorithm, data, curve, extractable);
});
});

{
var algorithm = {name: vector.name, namedCurve: curve};
var data = keyData[curve];
allValidUsages(vector.privateUsages).forEach(function(usages) {
testPkcs8PrivateOnly(algorithm, data, curve, usages);
});
}
});
});

Expand Down Expand Up @@ -171,6 +182,40 @@
}, "ECDH any JWK alg: " + keySize.toString() + " bits " + parameterString(format, false, keyData, algorithm, extractable, usages));
}

// Test importKey with pkcs8 without public key
// Should succeed in import, re-export as pkcs8, and export as jwk
function testPkcs8PrivateOnly(algorithm, data, keySize, usages) {
const format = "pkcs8";
const keyData = data.pkcs8_private_only;
promise_test(function(test) {
return subtle.importKey(format, keyData, algorithm, true, usages).
then(function(key) {
assert_equals(key.constructor, CryptoKey, "Imported a CryptoKey object");
assert_goodCryptoKey(key, algorithm, true, usages, 'private');

// Test re-export as pkcs8
return subtle.exportKey(format, key).
then(function(result) {
assert_true(result instanceof ArrayBuffer, "Re-exported pkcs8 is an ArrayBuffer");
const equal = equalBuffers(result, keyData.buffer) || equalBuffers(result, data.pkcs8.buffer);
assert_true(equal, "Round trip works");
// Test export as jwk
return subtle.exportKey('jwk', key);
}).then(function(jwkResult) {
assert_equals(jwkResult.kty, "EC", "Exported JWK has correct kty");
assert_equals(jwkResult.crv, algorithm.namedCurve, "Exported JWK has correct crv");
assert_true('x' in jwkResult, "Exported JWK has x");
assert_true('y' in jwkResult, "Exported JWK has y");
assert_true('d' in jwkResult, "Exported JWK has d");
}, function(err) {
assert_unreached("Export threw an unexpected error: " + err.toString());
});
}, function(err) {
assert_unreached("Import threw an unexpected error: " + err.toString());
});
}, "PKCS8 private-only: " + keySize.toString() + " bits " + parameterString(format, false, keyData, algorithm, true, usages));
}



// Helper methods follow:
Expand Down
7 changes: 7 additions & 0 deletions test/fixtures/wpt/url/resources/percent-encoding.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
"utf-8": "%E2%88%92"
}
},
{
"input": "\u00A2",
"output": {
"iso-8859-2": "%26%23162%3B",
"utf-8": "%C2%A2"
}
},
{
"input": "á|",
"output": {
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/wpt/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"path": "streams"
},
"url": {
"commit": "e3c46fdf5587369127de2863a7e38295f4e07f16",
"commit": "efb889eb4c9ca0b4e3ebd8ab308646b7483a8f54",
"path": "url"
},
"urlpattern": {
Expand All @@ -96,7 +96,7 @@
"path": "web-locks"
},
"WebCryptoAPI": {
"commit": "1e4933113d2028e092d07a9e865db8f606b21026",
"commit": "7cbe7e8ed962eac692ba4ad2e6ce3b9daafb65c0",
"path": "WebCryptoAPI"
},
"webidl": {
Expand Down
34 changes: 34 additions & 0 deletions test/sea/test-build-sea-custom-argv0.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'use strict';
// This tests --build-sea with a custom argv0 value.

require('../common');

const { skipIfBuildSEAIsNotSupported } = require('../common/sea');

skipIfBuildSEAIsNotSupported();

const tmpdir = require('../common/tmpdir');
const fixtures = require('../common/fixtures');
const { copyFileSync } = require('fs');

const { spawnSyncAndAssert } = require('../common/child_process');
tmpdir.refresh();

copyFileSync(
fixtures.path('sea', 'basic', 'sea-config.json'),
tmpdir.resolve('sea-config.json'),
);

copyFileSync(
fixtures.path('sea', 'basic', 'sea.js'),
tmpdir.resolve('sea.js'),
);

spawnSyncAndAssert(
process.execPath,
['--build-sea', tmpdir.resolve('sea-config.json')], {
cwd: tmpdir.path,
argv0: 'argv0',
}, {
stdout: /Generated single executable/,
});
4 changes: 2 additions & 2 deletions tools/nix/pkgs.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
arg:
let
repo = "https://github.com/NixOS/nixpkgs";
rev = "6308c3b21396534d8aaeac46179c14c439a89b8a";
rev = "ae67888ff7ef9dff69b3cf0cc0fbfbcd3a722abe";
nixpkgs = import (builtins.fetchTarball {
url = "${repo}/archive/${rev}.tar.gz";
sha256 = "14qnx22pkl9v4r0lxnnz18f4ybxj8cv18hyf1klzap98hckg58y4";
sha256 = "0hbf69ki28s8ss18x4qj9kpcw5afy8qfmd3gw1k6wn2lfhq5ddrz";
}) arg;
in
nixpkgs
5 changes: 1 addition & 4 deletions tools/nix/sharedLibDeps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
brotli
gtest
libuv
merve
nbytes
simdjson
simdutf
Expand All @@ -22,10 +23,6 @@
cares = pkgs.c-ares;
hdr-histogram = pkgs.hdrhistogram_c;
http-parser = pkgs.llhttp;
merve = pkgs.callPackage (builtins.fetchurl {
url = "https://github.com/NixOS/nixpkgs/raw/469b8e35e54d2880d73337c5ef2f1416b9b1dd43/pkgs/by-name/me/merve/package.nix";
sha256 = "0r2fmip48hcy4za6xfaml627x9m4218g6vlk5fiajmypfvxybzfy";
}) { };
nghttp2 = pkgs.nghttp2.overrideAttrs {
patches = [
(pkgs.fetchpatch2 {
Expand Down
Loading