Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index 805537448a6468d10659b611e4ea6f5a987409fd..5a3f4466c7a1f07caad09cae66d26ac536d29566 100644 |
--- a/src/builtins.cc |
+++ b/src/builtins.cc |
@@ -1777,6 +1777,21 @@ BUILTIN(DateToPrimitive) { |
} |
+// ES6 section 19.2.3.5 Function.prototype.toString ( ) |
+BUILTIN(FunctionPrototypeToString) { |
+ HandleScope scope(isolate); |
+ Handle<Object> receiver = args.receiver(); |
+ |
+ if (receiver->IsJSFunction()) { |
+ return *JSFunction::ToString(Handle<JSFunction>::cast(receiver)); |
+ } |
+ THROW_NEW_ERROR_RETURN_FAILURE( |
+ isolate, NewTypeError(MessageTemplate::kNotGeneric, |
+ isolate->factory()->NewStringFromAsciiChecked( |
+ "Function.prototype.toString"))); |
+} |
+ |
+ |
// ES6 section 19.4.1.1 Symbol ( [ description ] ) for the [[Call]] case. |
BUILTIN(SymbolConstructor) { |
HandleScope scope(isolate); |