mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 06:48:38 +09:00
Issue #1442 - Part 3: Implement ReadableStream and associated classes in the JS engine. https://bugzilla.mozilla.org/show_bug.cgi?id=1272697
This commit is contained in:
parent
62467428a3
commit
54e84f0f1d
13 changed files with 5178 additions and 5 deletions
|
|
@ -1003,6 +1003,13 @@ static const JSFunctionSpec number_methods[] = {
|
|||
JS_FS_END
|
||||
};
|
||||
|
||||
bool
|
||||
js::IsInteger(const Value& val)
|
||||
{
|
||||
return val.isInt32() ||
|
||||
(mozilla::IsFinite(val.toDouble()) && JS::ToInteger(val.toDouble()) == val.toDouble());
|
||||
}
|
||||
|
||||
// ES6 draft ES6 15.7.3.12
|
||||
static bool
|
||||
Number_isInteger(JSContext* cx, unsigned argc, Value* vp)
|
||||
|
|
@ -1013,9 +1020,7 @@ Number_isInteger(JSContext* cx, unsigned argc, Value* vp)
|
|||
return true;
|
||||
}
|
||||
Value val = args[0];
|
||||
args.rval().setBoolean(val.isInt32() ||
|
||||
(mozilla::IsFinite(val.toDouble()) &&
|
||||
JS::ToInteger(val.toDouble()) == val.toDouble()));
|
||||
args.rval().setBoolean(js::IsInteger(val));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue