cramforce / streamie

An extremely hackable full realtime twitter client
http://streamie.org
Other
493 stars 136 forks source link

settings.get returns undefined #17

Closed kosta closed 14 years ago

kosta commented 14 years ago

You said:

You can change settings.get to return null and do a console.log that a non-existing setting was accessed.

Return NULL? What are you, a JAVA programmer? I think you meant undefined :)

Note: I looked at the other settings.js functions, it seems they handle non-existent settings gracefully or throw a descriptive error.

Note2: I'm a bit confused about the state of my original pull request. Is this the last change you need?

cramforce commented 14 years ago

No, I mean null as

function returnNull() { return null; }

function returnUndefined() { var a; return a; }

also interesting typeof null

Yep, after the change I will pull it into the master.

kosta commented 14 years ago

Ok here you go: returns null.

Why do you want null instead of undefined if I may ask? My instinct about js is: if I access a non-existant property of an object, I get undefined.

settings.get sort of "feels the same", that's why I wanted to return undefined, too.

Or is using "undefined" bad js style? It's a while since I read "js: the good parts" :)

kosta commented 14 years ago

Included in http://github.com/cramforce/streamie/pull/11