[bigint] Adapt Object::NoSideEffectsToString.
R=jkummerow@chromium.org Bug: v8:6791 Change-Id: Ia46694ef236abd2fa037491a017eb825aa25162a Reviewed-on: https://chromium-review.googlesource.com/732981 Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Commit-Queue: Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/master@{#48856}
This commit is contained in:
parent
f681e53042
commit
94d9ffe71b
@ -265,6 +265,8 @@ bool HeapObject::IsExternalTwoByteString() const {
|
||||
|
||||
bool Object::IsNumber() const { return IsSmi() || IsHeapNumber(); }
|
||||
|
||||
bool Object::IsNumeric() const { return IsNumber() || IsBigInt(); }
|
||||
|
||||
bool HeapObject::IsFiller() const {
|
||||
InstanceType instance_type = map()->instance_type();
|
||||
return instance_type == FREE_SPACE_TYPE || instance_type == FILLER_TYPE;
|
||||
|
@ -324,7 +324,7 @@ Handle<String> Object::NoSideEffectsToString(Isolate* isolate,
|
||||
Handle<Object> input) {
|
||||
DisallowJavascriptExecution no_js(isolate);
|
||||
|
||||
if (input->IsString() || input->IsNumber() || input->IsOddball()) {
|
||||
if (input->IsString() || input->IsNumeric() || input->IsOddball()) {
|
||||
return Object::ToString(isolate, input).ToHandleChecked();
|
||||
} else if (input->IsFunction()) {
|
||||
// -- F u n c t i o n
|
||||
|
@ -964,7 +964,8 @@ template <class C> inline bool Is(Object* obj);
|
||||
V(LayoutDescriptor) \
|
||||
V(HeapObject) \
|
||||
V(Primitive) \
|
||||
V(Number)
|
||||
V(Number) \
|
||||
V(Numeric)
|
||||
|
||||
#define HEAP_OBJECT_ORDINARY_TYPE_LIST(V) \
|
||||
V(AbstractCode) \
|
||||
|
@ -57,6 +57,7 @@ TEST(NoSideEffectsToString) {
|
||||
CheckBoolean(isolate, true, "true");
|
||||
CheckBoolean(isolate, false, "false");
|
||||
CheckBoolean(isolate, false, "false");
|
||||
CheckObject(isolate, factory->NewBigIntFromInt(42), "42");
|
||||
CheckObject(isolate, factory->undefined_value(), "undefined");
|
||||
CheckObject(isolate, factory->null_value(), "null");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user