| Index: src/messages.js
|
| diff --git a/src/messages.js b/src/messages.js
|
| index 71a132563aa1da74cd07a7a61ea69e89d0e7bcb2..4d400f29209231643d80f2de6073efd5d8a8cbfa 100644
|
| --- a/src/messages.js
|
| +++ b/src/messages.js
|
| @@ -238,13 +238,6 @@
|
| }
|
|
|
|
|
| -function NoSideEffectsObjectToString() {
|
| - if (IS_UNDEFINED(this) && !IS_UNDETECTABLE(this)) return "[object Undefined]";
|
| - if (IS_NULL(this)) return "[object Null]";
|
| - return "[object " + %_ClassOf(TO_OBJECT_INLINE(this)) + "]";
|
| -}
|
| -
|
| -
|
| function NoSideEffectToString(obj) {
|
| if (IS_STRING(obj)) return obj;
|
| if (IS_NUMBER(obj)) return %_NumberToString(obj);
|
| @@ -252,7 +245,7 @@
|
| if (IS_UNDEFINED(obj)) return 'undefined';
|
| if (IS_NULL(obj)) return 'null';
|
| if (IS_FUNCTION(obj)) {
|
| - var str = %_CallFunction(obj, obj, $functionSourceString);
|
| + var str = %_CallFunction(obj, FunctionToString);
|
| if (str.length > 128) {
|
| str = %_SubString(str, 0, 111) + "...<omitted>..." +
|
| %_SubString(str, str.length - 2, str.length);
|
| @@ -261,7 +254,7 @@
|
| }
|
| if (IS_SYMBOL(obj)) return %_CallFunction(obj, $symbolToString);
|
| if (IS_OBJECT(obj)
|
| - && %GetDataProperty(obj, "toString") === $objectToString) {
|
| + && %GetDataProperty(obj, "toString") === ObjectToString) {
|
| var constructor = %GetDataProperty(obj, "constructor");
|
| if (typeof constructor == "function") {
|
| var constructorName = constructor.name;
|
| @@ -313,7 +306,7 @@
|
|
|
|
|
| function ToDetailString(obj) {
|
| - if (obj != null && IS_OBJECT(obj) && obj.toString === $objectToString) {
|
| + if (obj != null && IS_OBJECT(obj) && obj.toString === ObjectToString) {
|
| var constructor = obj.constructor;
|
| if (typeof constructor == "function") {
|
| var constructorName = constructor.name;
|
| @@ -591,7 +584,7 @@
|
| }
|
|
|
|
|
| -$setUpLockedPrototype(Script, [
|
| +SetUpLockedPrototype(Script, [
|
| "source",
|
| "name",
|
| "source_url",
|
| @@ -655,7 +648,7 @@
|
| }
|
|
|
|
|
| -$setUpLockedPrototype(SourceLocation,
|
| +SetUpLockedPrototype(SourceLocation,
|
| ["script", "position", "line", "column", "start", "end"],
|
| ["sourceText", SourceLocationSourceText]
|
| );
|
| @@ -699,7 +692,7 @@
|
| $stringSubstring);
|
| }
|
|
|
| -$setUpLockedPrototype(SourceSlice,
|
| +SetUpLockedPrototype(SourceSlice,
|
| ["script", "from_line", "to_line", "from_position", "to_position"],
|
| ["sourceText", SourceSliceSourceText]
|
| );
|
| @@ -794,8 +787,8 @@
|
| var fun = GET_PRIVATE(this, CallSiteFunctionKey);
|
| var ownName = fun.name;
|
| if (ownName && receiver &&
|
| - (%_CallFunction(receiver, ownName, $objectLookupGetter) === fun ||
|
| - %_CallFunction(receiver, ownName, $objectLookupSetter) === fun ||
|
| + (%_CallFunction(receiver, ownName, ObjectLookupGetter) === fun ||
|
| + %_CallFunction(receiver, ownName, ObjectLookupSetter) === fun ||
|
| (IS_OBJECT(receiver) && %GetDataProperty(receiver, ownName) === fun))) {
|
| // To handle DontEnum properties we guess that the method has
|
| // the same name as the function.
|
| @@ -803,8 +796,8 @@
|
| }
|
| var name = null;
|
| for (var prop in receiver) {
|
| - if (%_CallFunction(receiver, prop, $objectLookupGetter) === fun ||
|
| - %_CallFunction(receiver, prop, $objectLookupSetter) === fun ||
|
| + if (%_CallFunction(receiver, prop, ObjectLookupGetter) === fun ||
|
| + %_CallFunction(receiver, prop, ObjectLookupSetter) === fun ||
|
| (IS_OBJECT(receiver) && %GetDataProperty(receiver, prop) === fun)) {
|
| // If we find more than one match bail out to avoid confusion.
|
| if (name) {
|
| @@ -921,7 +914,7 @@
|
| return line;
|
| }
|
|
|
| -$setUpLockedPrototype(CallSite, ["receiver", "fun", "pos"], [
|
| +SetUpLockedPrototype(CallSite, ["receiver", "fun", "pos"], [
|
| "getThis", CallSiteGetThis,
|
| "getTypeName", CallSiteGetTypeName,
|
| "isToplevel", CallSiteIsToplevel,
|
| @@ -1110,9 +1103,9 @@
|
| // when constructing the initial Error prototytpes.
|
| var captureStackTrace = function captureStackTrace(obj, cons_opt) {
|
| // Define accessors first, as this may fail and throw.
|
| - $objectDefineProperty(obj, 'stack', { get: StackTraceGetter,
|
| - set: StackTraceSetter,
|
| - configurable: true });
|
| + ObjectDefineProperty(obj, 'stack', { get: StackTraceGetter,
|
| + set: StackTraceSetter,
|
| + configurable: true });
|
| %CollectStackTrace(obj, cons_opt ? cons_opt : captureStackTrace);
|
| }
|
|
|
| @@ -1236,8 +1229,7 @@
|
| }
|
| }
|
|
|
| -$installFunctions(GlobalError.prototype, DONT_ENUM,
|
| - ['toString', ErrorToString]);
|
| +InstallFunctions(GlobalError.prototype, DONT_ENUM, ['toString', ErrorToString]);
|
|
|
| $errorToString = ErrorToString;
|
| $formatMessage = FormatMessage;
|
|
|