OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/ast/ast-expression-rewriter.h" | 9 #include "src/ast/ast-expression-rewriter.h" |
10 #include "src/ast/ast-expression-visitor.h" | 10 #include "src/ast/ast-expression-visitor.h" |
(...skipping 4975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4986 return args->at(0); | 4986 return args->at(0); |
4987 } else { | 4987 } else { |
4988 ReportMessage(MessageTemplate::kNotIsvar); | 4988 ReportMessage(MessageTemplate::kNotIsvar); |
4989 *ok = false; | 4989 *ok = false; |
4990 return NULL; | 4990 return NULL; |
4991 } | 4991 } |
4992 } | 4992 } |
4993 | 4993 |
4994 // Check that the expected number of arguments are being passed. | 4994 // Check that the expected number of arguments are being passed. |
4995 if (function->nargs != -1 && function->nargs != args->length()) { | 4995 if (function->nargs != -1 && function->nargs != args->length()) { |
4996 ReportMessage(MessageTemplate::kIllegalAccess); | 4996 ReportMessage(MessageTemplate::kRuntimeWrongNumArgs); |
4997 *ok = false; | 4997 *ok = false; |
4998 return NULL; | 4998 return NULL; |
4999 } | 4999 } |
5000 | 5000 |
5001 return factory()->NewCallRuntime(function, args, pos); | 5001 return factory()->NewCallRuntime(function, args, pos); |
5002 } | 5002 } |
5003 | 5003 |
5004 int context_index = Context::IntrinsicIndexForName(name->string()); | 5004 int context_index = Context::IntrinsicIndexForName(name->string()); |
5005 | 5005 |
5006 // Check that the function is defined. | 5006 // Check that the function is defined. |
(...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6930 Expression* do_each = | 6930 Expression* do_each = |
6931 factory->NewDoExpression(new_assign_each, var_each, nopos); | 6931 factory->NewDoExpression(new_assign_each, var_each, nopos); |
6932 loop->set_assign_each(do_each); | 6932 loop->set_assign_each(do_each); |
6933 | 6933 |
6934 return final_loop; | 6934 return final_loop; |
6935 } | 6935 } |
6936 | 6936 |
6937 | 6937 |
6938 } // namespace internal | 6938 } // namespace internal |
6939 } // namespace v8 | 6939 } // namespace v8 |
OLD | NEW |