| Index: src/runtime.js
|
| diff --git a/src/runtime.js b/src/runtime.js
|
| index 8ae676110be18cf955f7339dcbab9f43b5d8f58c..6bbb375e767681e5b6f238a096fee76cd2921236 100644
|
| --- a/src/runtime.js
|
| +++ b/src/runtime.js
|
| @@ -377,7 +377,9 @@ function FILTER_KEY(key) {
|
| function CALL_NON_FUNCTION() {
|
| var delegate = %GetFunctionDelegate(this);
|
| if (!IS_FUNCTION(delegate)) {
|
| - throw %MakeTypeError('called_non_callable', [typeof this]);
|
| + var callsite = %RenderCallSite();
|
| + if (callsite == "") callsite = typeof this;
|
| + throw %MakeTypeError('called_non_callable', [callsite]);
|
| }
|
| return %Apply(delegate, this, arguments, 0, %_ArgumentsLength());
|
| }
|
| @@ -386,7 +388,9 @@ function CALL_NON_FUNCTION() {
|
| function CALL_NON_FUNCTION_AS_CONSTRUCTOR() {
|
| var delegate = %GetConstructorDelegate(this);
|
| if (!IS_FUNCTION(delegate)) {
|
| - throw %MakeTypeError('called_non_callable', [typeof this]);
|
| + var callsite = %RenderCallSite();
|
| + if (callsite == "") callsite = typeof this;
|
| + throw %MakeTypeError('called_non_callable', [callsite]);
|
| }
|
| return %Apply(delegate, this, arguments, 0, %_ArgumentsLength());
|
| }
|
|
|