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

Unified Diff: test/mjsunit/regress/regress-crbug-3184.js

Issue 543087: Fix build problems. (Closed)
Patch Set: Created 10 years, 11 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
« test/cctest/test-serialize.cc ('K') | « test/cctest/test-serialize.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-crbug-3184.js
diff --git a/test/mjsunit/regress/regress-crbug-3184.js b/test/mjsunit/regress/regress-crbug-3184.js
index 6a851ee164e7b15aa7edb0976f1b598fa306a2b3..ed78183f78c48f148ab0a56be973d56ef91cd2f5 100644
--- a/test/mjsunit/regress/regress-crbug-3184.js
+++ b/test/mjsunit/regress/regress-crbug-3184.js
@@ -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));
« test/cctest/test-serialize.cc ('K') | « test/cctest/test-serialize.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698