Revision: 3622
Author: [email protected]
Date: Fri Jan 15 12:15:47 2010
Log: Fix build problems.
Review URL: http://codereview.chromium.org/543087
http://code.google.com/p/v8/source/detail?r=3622
Modified:
/branches/bleeding_edge/test/cctest/test-serialize.cc
/branches/bleeding_edge/test/mjsunit/regress/regress-crbug-3184.js
=======================================
--- /branches/bleeding_edge/test/cctest/test-serialize.cc Fri Jan 15
06:20:31 2010
+++ /branches/bleeding_edge/test/cctest/test-serialize.cc Fri Jan 15
12:15:47 2010
@@ -364,6 +364,11 @@
FILE* fp = OS::FOpen(name.start(), "ra");
int new_size, pointer_size, data_size, code_size, map_size, cell_size;
int large_size;
+#ifdef _MSC_VER
+ // Avoid warning about unsafe fscanf from MSVC.
+ // Please note that this is only fine if %c and %s are not being used.
+#define fscanf fscanf_s
+#endif
CHECK_EQ(1, fscanf(fp, "new %d\n", &new_size));
CHECK_EQ(1, fscanf(fp, "pointer %d\n", &pointer_size));
CHECK_EQ(1, fscanf(fp, "data %d\n", &data_size));
@@ -371,6 +376,9 @@
CHECK_EQ(1, fscanf(fp, "map %d\n", &map_size));
CHECK_EQ(1, fscanf(fp, "cell %d\n", &cell_size));
CHECK_EQ(1, fscanf(fp, "large %d\n", &large_size));
+#ifdef _MSC_VER
+#undef fscanf
+#endif
fclose(fp);
Heap::ReserveSpace(new_size,
pointer_size,
=======================================
--- /branches/bleeding_edge/test/mjsunit/regress/regress-crbug-3184.js Fri
Jan 15 07:34:32 2010
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-crbug-3184.js Fri
Jan 15 12:15:47 2010
@@ -26,57 +26,57 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Object.extend = function (dest, source) {
- for (property in source) dest[property] = source[property];
- return dest;
+ for (property in source) dest[property] = source[property];
+ return dest;
};
Object.extend ( Function.prototype,
{
- wrap : function (wrapper) {
- var method = this;
- var bmethod = (function(_method) {
- return function () {
- this.$$$parentMethodStore$$$ = this.$proceed;
- this.$proceed = function() { return
_method.apply(this, arguments); };
- };
- })(method);
- var amethod = function () {
- this.$proceed = this.$$$parentMethodStore$$$;
- if (this.$proceed == undefined) delete this.$proceed;
- delete this.$$$parentMethodStore$$$;
- };
- var value = function() { bmethod.call(this); retval =
wrapper.apply(this, arguments); amethod.call(this); return retval; };
- return value;
- }
+ wrap : function (wrapper) {
+ var method = this;
+ var bmethod = (function(_method) {
+ return function () {
+ this.$$$parentMethodStore$$$ = this.$proceed;
+ this.$proceed = function() { return _method.apply(this,
arguments); };
+ };
+ })(method);
+ var amethod = function () {
+ this.$proceed = this.$$$parentMethodStore$$$;
+ if (this.$proceed == undefined) delete this.$proceed;
+ delete this.$$$parentMethodStore$$$;
+ };
+ var value = function() { bmethod.call(this); retval =
wrapper.apply(this, arguments); amethod.call(this); return retval; };
+ return value;
+ }
});
String.prototype.cap = function() {
- return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
+ return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
};
String.prototype.cap = String.prototype.cap.wrap(
- function(each) {
- if (each && this.indexOf(" ") != -1) {
- return this.split(" ").map(
- function (value) {
- return value.cap();
- }
- ).join(" ");
- } else {
- return this.$proceed();
- }
+ function(each) {
+ if (each && this.indexOf(" ") != -1) {
+ return this.split(" ").map(
+ function (value) {
+ return value.cap();
+ }
+ ).join(" ");
+ } else {
+ return this.$proceed();
+ }
});
Object.extend( Array.prototype,
{
- map : function(fun) {
- if (typeof fun != "function") throw new TypeError();
- var len = this.length;
- var res = new Array(len);
- var thisp = arguments[1];
- for (var i = 0; i < len; i++) { if (i in this) res[i] = fun.call(thisp,
this[i], i, this); }
- return res;
- }
+ map : function(fun) {
+ if (typeof fun != "function") throw new TypeError();
+ var len = this.length;
+ var res = new Array(len);
+ var thisp = arguments[1];
+ for (var i = 0; i < len; i++) { if (i in this) res[i] =
fun.call(thisp, this[i], i, this); }
+ return res;
+ }
});
assertEquals("Test1 test1", "test1 test1".cap());
assertEquals("Test2 Test2", "test2 test2".cap(true));
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev