Created
December 7, 2011 18:23
-
-
Save manko/1443963 to your computer and use it in GitHub Desktop.
Changes needed to SC.Cookie for SC1.x -> SC2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -92,7 +92,7 @@ | |
| this.set('expires', -1); | |
| this.write(); | |
| - arguments.callee.base.apply(this,arguments); | |
| + this._super(); | |
| }, | |
| /** | |
| @@ -112,7 +112,7 @@ | |
| date; | |
| if (expires) { | |
| - if (typeof expires === SC.T_NUMBER) { | |
| + if (SC.typeOf(expires) === 'number') { | |
| date = new Date(); | |
| date.setTime(date.getTime() + (expires*24*60*60*1000)); | |
| } else if (SC.DateTime && expires.get && expires.get('milliseconds')) { | |
| @@ -135,7 +135,7 @@ | |
| }); | |
| -SC.Cookie.mixin( | |
| +SC.Cookie.reopenClass( | |
| /** @scope SC.Cookie */ { | |
| /** | |
| @@ -148,7 +148,7 @@ | |
| if (document.cookie && document.cookie !== '') { | |
| var cookies = document.cookie.split(';'); | |
| for (var i = 0; i < cookies.length; i++) { | |
| - var cookie = SC.String.trim(String(cookies[i])); | |
| + var cookie = String(cookies[i]).trim(); | |
| if (cookie.substring(0, name.length + 1) === (name + "=")) { | |
| return SC.Cookie.create({ | |
| name: name, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment