| Index: src/ast-value-factory.h
|
| diff --git a/src/ast-value-factory.h b/src/ast-value-factory.h
|
| index dd575e26abe337585351d96cbfddced2961cb23b..1b435f33eb57b12c446876c23b51582467d5ccc5 100644
|
| --- a/src/ast-value-factory.h
|
| +++ b/src/ast-value-factory.h
|
| @@ -142,9 +142,11 @@ class AstValue : public ZoneObject {
|
| }
|
|
|
| bool IsNumber() const {
|
| - return type_ == NUMBER || type_ == SMI;
|
| + return type_ == NUMBER || type_ == NUMBER_WITH_DOT || type_ == SMI;
|
| }
|
|
|
| + bool ContainsDot() const { return type_ == NUMBER_WITH_DOT; }
|
| +
|
| const AstRawString* AsString() const {
|
| if (type_ == STRING)
|
| return string_;
|
| @@ -153,8 +155,7 @@ class AstValue : public ZoneObject {
|
| }
|
|
|
| double AsNumber() const {
|
| - if (type_ == NUMBER)
|
| - return number_;
|
| + if (type_ == NUMBER || type_ == NUMBER_WITH_DOT) return number_;
|
| if (type_ == SMI)
|
| return smi_;
|
| UNREACHABLE();
|
| @@ -189,6 +190,7 @@ class AstValue : public ZoneObject {
|
| STRING,
|
| SYMBOL,
|
| NUMBER,
|
| + NUMBER_WITH_DOT,
|
| SMI,
|
| BOOLEAN,
|
| NULL_TYPE,
|
| @@ -213,6 +215,11 @@ class AstValue : public ZoneObject {
|
| DCHECK(t == NULL_TYPE || t == UNDEFINED || t == THE_HOLE);
|
| }
|
|
|
| + void MarkWithDot() {
|
| + DCHECK(type_ == NUMBER);
|
| + type_ = NUMBER_WITH_DOT;
|
| + }
|
| +
|
| Type type_;
|
|
|
| // Uninternalized value.
|
| @@ -334,7 +341,7 @@ class AstValueFactory {
|
| const AstValue* NewString(const AstRawString* string);
|
| // A JavaScript symbol (ECMA-262 edition 6).
|
| const AstValue* NewSymbol(const char* name);
|
| - const AstValue* NewNumber(double number);
|
| + const AstValue* NewNumber(double number, bool with_dot = false);
|
| const AstValue* NewSmi(int number);
|
| const AstValue* NewBoolean(bool b);
|
| const AstValue* NewStringList(ZoneList<const AstRawString*>* strings);
|
|
|