Skip to content

Commit

Permalink
src: update outdated references to spec sections
Browse files Browse the repository at this point in the history
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: nodejs#53832
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Marco Ippolito <[email protected]>
  • Loading branch information
tniessen authored and ehsankhfr committed Jul 18, 2024
1 parent aadaf03 commit c6d827f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/util-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c6d827f

Please sign in to comment.