Chromium Code Reviews| Index: src/func-name-inferrer.cc |
| diff --git a/src/func-name-inferrer.cc b/src/func-name-inferrer.cc |
| index b3a64b26f826d6a3f13116745f37792fe05e1dfb..7ea76a230a57fc6ba85315aef32572b5834178dc 100644 |
| --- a/src/func-name-inferrer.cc |
| +++ b/src/func-name-inferrer.cc |
| @@ -39,6 +39,31 @@ void FuncNameInferrer::PushLiteralName(const AstRawString* name) { |
| } |
| +void FuncNameInferrer::PushLiteralName(const AstValue* name) { |
| + if (name->IsString()) { |
| + PushLiteralName(name->AsString()); |
| + } else if (name->IsNumber()) { |
| + UNREACHABLE(); |
|
arv (Not doing code reviews)
2014/12/10 23:38:13
removing
arv (Not doing code reviews)
2014/12/11 23:10:33
I removed all the changes to func-name-inferrer.
|
| + double double_value = name->AsNumber(); |
| + char array[100]; |
| + const char* string = |
| + DoubleToCString(double_value, Vector<char>(array, arraysize(array))); |
| + PushLiteralName(ast_value_factory_->GetOneByteString(string)); |
| + } else { |
| + UNREACHABLE(); |
| + } |
| +} |
| + |
| + |
| +void FuncNameInferrer::PushLiteralName(Expression* expression) { |
| + if (expression->IsVariableProxy()) { |
| + PushLiteralName(expression->AsVariableProxy()->raw_name()); |
| + } else if (expression->IsLiteral()) { |
| + PushLiteralName(expression->AsLiteral()->raw_value()); |
| + } |
| +} |
| + |
| + |
| void FuncNameInferrer::PushVariableName(const AstRawString* name) { |
| if (IsOpen() && name != ast_value_factory_->dot_result_string()) { |
| names_stack_.Add(Name(name, kVariableName), zone()); |