Reviewers: Rico,
Description:
Merge r8979 to 3.3 branch.
Please review this at http://codereview.chromium.org/7694029/
SVN Base: https://v8.googlecode.com/svn/branches/3.3
Affected files:
M src/messages.js
M src/string.js
M src/v8natives.js
M src/version.cc
Index: src/messages.js
diff --git a/src/messages.js b/src/messages.js
index
8d79ed1ff4de82170b35a32bc0874ad7f777ead8..94cc208530bf76f1cd98f8733385a9bf67e023f5
100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -1,4 +1,4 @@
-// Copyright 2006-2008 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -57,7 +57,7 @@ function FormatString(format, message) {
for (var i = 0; i < format.length; i++) {
var str = format[i];
for (arg_num = 0; arg_num < kReplacementMarkers.length; arg_num++) {
- if (format[i] !== kReplacementMarkers[arg_num]) continue;
+ if (str !== kReplacementMarkers[arg_num]) continue;
try {
str = ToDetailString(args[arg_num]);
} catch (e) {
@@ -100,7 +100,8 @@ function ToStringCheckErrorObject(obj) {
function ToDetailString(obj) {
- if (obj != null && IS_OBJECT(obj) && obj.toString ===
$Object.prototype.toString) {
+ if (obj != null && IS_OBJECT(obj) &&
+ obj.toString === $Object.prototype.toString) {
var constructor = obj.constructor;
if (!constructor) return ToStringCheckErrorObject(obj);
var constructorName = constructor.name;
@@ -550,6 +551,7 @@ function SourceLocation(script, position, line, column,
start, end) {
this.end = end;
}
+SourceLocation.prototype.__proto__ = null;
const kLineLengthLimit = 78;
@@ -639,6 +641,7 @@ function SourceSlice(script, from_line, to_line,
from_position, to_position) {
this.to_position = to_position;
}
+SourceSlice.prototype.__proto__ = null;
/**
* Get the source text for a SourceSlice
@@ -700,23 +703,28 @@ function CallSite(receiver, fun, pos) {
this.pos = pos;
}
+CallSite.prototype.__proto__ = null;
+
CallSite.prototype.getThis = function () {
return this.receiver;
};
CallSite.prototype.getTypeName = function () {
var constructor = this.receiver.constructor;
- if (!constructor)
+ if (!constructor) {
return %_CallFunction(this.receiver, ObjectToString);
+ }
var constructorName = constructor.name;
- if (!constructorName)
+ if (!constructorName) {
return %_CallFunction(this.receiver, ObjectToString);
+ }
return constructorName;
};
CallSite.prototype.isToplevel = function () {
- if (this.receiver == null)
+ if (this.receiver == null) {
return true;
+ }
return IS_GLOBAL(this.receiver);
};
@@ -749,8 +757,9 @@ CallSite.prototype.getFunctionName = function () {
}
// Maybe this is an evaluation?
var script = %FunctionGetScript(this.fun);
- if (script && script.compilation_type == COMPILATION_TYPE_EVAL)
+ if (script && script.compilation_type == COMPILATION_TYPE_EVAL) {
return "eval";
+ }
return null;
};
@@ -772,13 +781,15 @@ CallSite.prototype.getMethodName = function () {
this.receiver.__lookupSetter__(prop) === this.fun ||
(!this.receiver.__lookupGetter__(prop) && this.receiver[prop] ===
this.fun)) {
// If we find more than one match bail out to avoid confusion.
- if (name)
+ if (name) {
return null;
+ }
name = prop;
}
}
- if (name)
+ if (name) {
return name;
+ }
return null;
};
@@ -788,8 +799,9 @@ CallSite.prototype.getFileName = function () {
};
CallSite.prototype.getLineNumber = function () {
- if (this.pos == -1)
+ if (this.pos == -1) {
return null;
+ }
var script = %FunctionGetScript(this.fun);
var location = null;
if (script) {
@@ -799,8 +811,9 @@ CallSite.prototype.getLineNumber = function () {
};
CallSite.prototype.getColumnNumber = function () {
- if (this.pos == -1)
+ if (this.pos == -1) {
return null;
+ }
var script = %FunctionGetScript(this.fun);
var location = null;
if (script) {
@@ -820,15 +833,17 @@ CallSite.prototype.getPosition = function () {
CallSite.prototype.isConstructor = function () {
var constructor = this.receiver ? this.receiver.constructor : null;
- if (!constructor)
+ if (!constructor) {
return false;
+ }
return this.fun === constructor;
};
function FormatEvalOrigin(script) {
var sourceURL = script.nameOrSourceURL();
- if (sourceURL)
+ if (sourceURL) {
return sourceURL;
+ }
var eval_origin = "eval at ";
if (script.eval_from_function_name) {
@@ -1023,8 +1038,9 @@ function DefineError(f) {
function captureStackTrace(obj, cons_opt) {
var stackTraceLimit = $Error.stackTraceLimit;
if (!stackTraceLimit || !IS_NUMBER(stackTraceLimit)) return;
- if (stackTraceLimit < 0 || stackTraceLimit > 10000)
+ if (stackTraceLimit < 0 || stackTraceLimit > 10000) {
stackTraceLimit = 10000;
+ }
var raw_stack = %CollectStackTrace(cons_opt
? cons_opt
: captureStackTrace, stackTraceLimit);
@@ -1084,8 +1100,10 @@ function errorToString() {
} catch(e) {
// If this error message was encountered already return the empty
// string for it instead of recursively formatting it.
- if (isCyclicErrorMarker(e)) return '';
- else throw e;
+ if (isCyclicErrorMarker(e)) {
+ return '';
+ }
+ throw e;
}
}
Index: src/string.js
diff --git a/src/string.js b/src/string.js
index
88a6dc1b24539a577a28f1f9fe1e505e956df4e9..f24862cd92268048683ef2a82345a6f783b26b5a
100644
--- a/src/string.js
+++ b/src/string.js
@@ -909,6 +909,8 @@ function ReplaceResultBuilder(str) {
this.special_string = str;
}
+ReplaceResultBuilder.prototype.__proto__ = null;
+
ReplaceResultBuilder.prototype.add = function(str) {
str = TO_STRING_INLINE(str);
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index
d22e94d85ee5416bfdab7d48ae5e23b469084858..e27f3b00a34a94375d12eee1aafbdc6f78076532
100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -404,6 +404,7 @@ function PropertyDescriptor() {
}
PropertyDescriptor.prototype.__proto__ = null;
+
PropertyDescriptor.prototype.toString = function() {
return "[object PropertyDescriptor]";
};
Index: src/version.cc
diff --git a/src/version.cc b/src/version.cc
index
c278f4d56f4ceac7dea22a2853dca3aa974878f7..1426b9c464a408fcda773ada205f9acbf7d7308d
100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 3
#define MINOR_VERSION 3
#define BUILD_NUMBER 10
-#define PATCH_LEVEL 30
+#define PATCH_LEVEL 31
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define IS_CANDIDATE_VERSION 0
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev