Skip to content

Instantly share code, notes, and snippets.

@manko
Created December 7, 2011 18:23
Show Gist options
  • Select an option

  • Save manko/1443963 to your computer and use it in GitHub Desktop.

Select an option

Save manko/1443963 to your computer and use it in GitHub Desktop.
Changes needed to SC.Cookie for SC1.x -> SC2
@@ -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