| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1907,7 +1907,7 @@ def configure_library(lib, output, pkgname=None): | |||
| 1907 | 1907 | ||
| 1908 | 1908 | ||
| 1909 | 1909 | def configure_v8(o, configs): | |
| 1910 | - set_configuration_variable(configs, 'v8_enable_v8_checks', release=1, debug=0) | ||
| 1910 | + set_configuration_variable(configs, 'v8_enable_v8_checks', release=0, debug=1) | ||
| 1911 | 1911 | ||
| 1912 | 1912 | o['variables']['v8_enable_webassembly'] = 0 if options.v8_lite_mode else 1 | |
| 1913 | 1913 | o['variables']['v8_enable_javascript_promise_hooks'] = 1 | |
@@ -2537,11 +2537,10 @@ def make_bin_override(): | |||
| 2537 | 2537 | del configurations['Release']['variables'] | |
| 2538 | 2538 | config_debug_vars = configurations['Debug']['variables'] | |
| 2539 | 2539 | del configurations['Debug']['variables'] | |
| 2540 | - output['conditions'].append(['build_type=="Release"', { | ||
| 2541 | - 'variables': config_release_vars, | ||
| 2542 | - }, { | ||
| 2543 | - 'variables': config_debug_vars, | ||
| 2544 | - }]) | ||
| 2540 | + if options.debug: | ||
| 2541 | + variables = variables | config_debug_vars | ||
| 2542 | + else: | ||
| 2543 | + variables = variables | config_release_vars | ||
| 2545 | 2544 | ||
| 2546 | 2545 | # make_global_settings should be a root level element too | |
| 2547 | 2546 | if 'make_global_settings' in output: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -580,7 +580,7 @@ changes: | |||
| 580 | 580 | ||
| 581 | 581 | > Stability: 1.1 - Active development | |
| 582 | 582 | ||
| 583 | - * `frameCount` {number} Optional number of frames to capture as call site objects. | ||
| 583 | + * `frameCount` {integer} Optional number of frames to capture as call site objects. | ||
| 584 | 584 | **Default:** `10`. Allowable range is between 1 and 200. | |
| 585 | 585 | * `options` {Object} Optional | |
| 586 | 586 | * `sourceMap` {boolean} Reconstruct the original location in the stacktrace from the source-map. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,6 +66,7 @@ const { | |||
| 66 | 66 | validateString, | |
| 67 | 67 | validateOneOf, | |
| 68 | 68 | validateObject, | |
| 69 | + validateInteger, | ||
| 69 | 70 | } = require('internal/validators'); | |
| 70 | 71 | const { | |
| 71 | 72 | isReadableStream, | |
@@ -452,7 +453,7 @@ function getCallSites(frameCount = 10, options) { | |||
| 452 | 453 | } | |
| 453 | 454 | ||
| 454 | 455 | // Using kDefaultMaxCallStackSizeToCapture as reference | |
| 455 | - validateNumber(frameCount, 'frameCount', 1, 200); | ||
| 456 | + validateInteger(frameCount, 'frameCount', 1, 200); | ||
| 456 | 457 | // If options.sourceMaps is true or if sourceMaps are enabled but the option.sourceMaps is not set explicitly to false | |
| 457 | 458 | if (options.sourceMap === true || (getOptionValue('--enable-source-maps') && options.sourceMap !== false)) { | |
| 458 | 459 | return mapCallSite(binding.getCallSites(frameCount)); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,7 +89,7 @@ class JSGraph : public EmbedderGraph { | |||
| 89 | 89 | } | |
| 90 | 90 | ||
| 91 | 91 | Node* V8Node(const Local<v8::Value>& value) override { | |
| 92 | - return V8Node(value.As<v8::Data>()); | ||
| 92 | + return V8Node(v8::Local<v8::Data>(value)); | ||
| 93 | 93 | } | |
| 94 | 94 | ||
| 95 | 95 | Node* AddNode(std::unique_ptr<Node> node) override { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,6 +9,7 @@ | |||
| 9 | 9 | #include "quic/guard.h" | |
| 10 | 10 | #include "simdutf.h" | |
| 11 | 11 | #include "util-inl.h" | |
| 12 | + #include "v8-value.h" | ||
| 12 | 13 | ||
| 13 | 14 | namespace node { | |
| 14 | 15 | namespace builtins { | |
@@ -441,7 +442,7 @@ void BuiltinLoader::SaveCodeCache(const std::string& id, Local<Data> data) { | |||
| 441 | 442 | new_cached_data.reset( | |
| 442 | 443 | ScriptCompiler::CreateCodeCache(mod->GetUnboundModuleScript())); | |
| 443 | 444 | } else { | |
| 444 | - Local<Function> fun = data.As<Function>(); | ||
| 445 | + Local<Function> fun = data.As<Value>().As<Function>(); | ||
| 445 | 446 | new_cached_data.reset(ScriptCompiler::CreateCodeCacheForFunction(fun)); | |
| 446 | 447 | } | |
| 447 | 448 | CHECK_NOT_NULL(new_cached_data); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -258,7 +258,7 @@ static void GetCallSites(const FunctionCallbackInfo<Value>& args) { | |||
| 258 | 258 | Environment* env = Environment::GetCurrent(context); | |
| 259 | 259 | ||
| 260 | 260 | CHECK_EQ(args.Length(), 1); | |
| 261 | - CHECK(args[0]->IsNumber()); | ||
| 261 | + CHECK(args[0]->IsUint32()); | ||
| 262 | 262 | const uint32_t frames = args[0].As<Uint32>()->Value(); | |
| 263 | 263 | CHECK(frames >= 1 && frames <= 200); | |
| 264 | 264 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,6 +22,7 @@ | |||
| 22 | 22 | #ifndef SRC_UTIL_INL_H_ | |
| 23 | 23 | #define SRC_UTIL_INL_H_ | |
| 24 | 24 | ||
| 25 | + #include "v8-isolate.h" | ||
| 25 | 26 | #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS | |
| 26 | 27 | ||
| 27 | 28 | #include <cmath> | |
@@ -678,10 +679,15 @@ T FromV8Value(v8::Local<v8::Value> value) { | |||
| 678 | 679 | "Type is out of unsigned integer range"); | |
| 679 | 680 | if constexpr (!loose) { | |
| 680 | 681 | CHECK(value->IsUint32()); | |
| 682 | + return static_cast<T>(value.As<v8::Uint32>()->Value()); | ||
| 681 | 683 | } else { | |
| 682 | 684 | CHECK(value->IsNumber()); | |
| 685 | + v8::Isolate* isolate = v8::Isolate::GetCurrent(); | ||
| 686 | + v8::Local<v8::Context> context = isolate->GetCurrentContext(); | ||
| 687 | + v8::Maybe<uint32_t> maybe = value->Uint32Value(context); | ||
| 688 | + CHECK(!maybe.IsNothing()); | ||
| 689 | + return static_cast<T>(maybe.FromJust()); | ||
| 683 | 690 | } | |
| 684 | - return static_cast<T>(value.As<v8::Uint32>()->Value()); | ||
| 685 | 691 | } else if constexpr (std::is_integral_v<T> && std::is_signed_v<T>) { | |
| 686 | 692 | static_assert( | |
| 687 | 693 | std::numeric_limits<T>::max() <= std::numeric_limits<int32_t>::max() && | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,15 +31,14 @@ const assert = require('node:assert'); | |||
| 31 | 31 | ); | |
| 32 | 32 | } | |
| 33 | 33 | ||
| 34 | - // Guarantee dot-right numbers are ignored | ||
| 34 | + // frameCount must be an integer | ||
| 35 | 35 | { | |
| 36 | - const callSites = getCallSites(3.6); | ||
| 37 | - assert.strictEqual(callSites.length, 3); | ||
| 38 | - } | ||
| 39 | - | ||
| 40 | - { | ||
| 41 | - const callSites = getCallSites(3.4); | ||
| 42 | - assert.strictEqual(callSites.length, 3); | ||
| 36 | + assert.throws(() => { | ||
| 37 | + const callSites = getCallSites(3.6); | ||
| 38 | + assert.strictEqual(callSites.length, 3); | ||
| 39 | + }, common.expectsError({ | ||
| 40 | + code: 'ERR_OUT_OF_RANGE' | ||
| 41 | + })); | ||
| 43 | 42 | } | |
| 44 | 43 | ||
| 45 | 44 | { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments