Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(511)

Unified Diff: src/messages.js

Issue 1121453003: Revert of Wrap v8natives.js into a function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/math.js ('k') | src/mirror-debugger.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.js
diff --git a/src/messages.js b/src/messages.js
index 9b2c4400261ba4448ebbc2b92bfa4b6fb988778d..b81215ebe9b794ed5926b3a64ea56b29389c1e8c 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -243,13 +243,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);
@@ -257,7 +250,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);
@@ -266,7 +259,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;
@@ -318,7 +311,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;
@@ -596,7 +589,7 @@
}
-$setUpLockedPrototype(Script, [
+SetUpLockedPrototype(Script, [
"source",
"name",
"source_url",
@@ -660,7 +653,7 @@
}
-$setUpLockedPrototype(SourceLocation,
+SetUpLockedPrototype(SourceLocation,
["script", "position", "line", "column", "start", "end"],
["sourceText", SourceLocationSourceText]
);
@@ -704,7 +697,7 @@
$stringSubstring);
}
-$setUpLockedPrototype(SourceSlice,
+SetUpLockedPrototype(SourceSlice,
["script", "from_line", "to_line", "from_position", "to_position"],
["sourceText", SourceSliceSourceText]
);
@@ -799,8 +792,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.
@@ -808,8 +801,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) {
@@ -926,7 +919,7 @@
return line;
}
-$setUpLockedPrototype(CallSite, ["receiver", "fun", "pos"], [
+SetUpLockedPrototype(CallSite, ["receiver", "fun", "pos"], [
"getThis", CallSiteGetThis,
"getTypeName", CallSiteGetTypeName,
"isToplevel", CallSiteIsToplevel,
@@ -1115,9 +1108,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);
}
@@ -1241,8 +1234,7 @@
}
}
-$installFunctions(GlobalError.prototype, DONT_ENUM,
- ['toString', ErrorToString]);
+InstallFunctions(GlobalError.prototype, DONT_ENUM, ['toString', ErrorToString]);
$errorToString = ErrorToString;
$formatMessage = FormatMessage;
« no previous file with comments | « src/math.js ('k') | src/mirror-debugger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698