src: update outdated references to spec sections

The exact section has changed in recent versions of ECMA-262, so fix the
section number and explicitly mark the edition of the standard to avoid
having to update it in the future.

PR-URL: https://github.com/nodejs/node/pull/53832
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
This commit is contained in:
Tobias Nießen 2024-07-15 22:01:14 +02:00 committed by GitHub
parent 953abf4887
commit 3a43e55a00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -501,7 +501,7 @@ void ArrayBufferViewContents<T, S>::ReadValue(v8::Local<v8::Value> buf) {
}
}
// ECMA262 20.1.2.5
// ECMA-262, 15th edition, 21.1.2.5. Number.isSafeInteger
inline bool IsSafeJsInt(v8::Local<v8::Value> v) {
if (!v->IsNumber()) return false;
double v_d = v.As<v8::Number>()->Value();

View File

@ -215,7 +215,7 @@ void DumpJavaScriptBacktrace(FILE* fp);
#define UNREACHABLE(...) \
ERROR_AND_ABORT("Unreachable code reached" __VA_OPT__(": ") __VA_ARGS__)
// ECMA262 20.1.2.6 Number.MAX_SAFE_INTEGER (2^53-1)
// ECMA-262, 15th edition, 21.1.2.6. Number.MAX_SAFE_INTEGER (2^53-1)
constexpr int64_t kMaxSafeJsInteger = 9007199254740991;
inline bool IsSafeJsInt(v8::Local<v8::Value> v);