I thought there’s cases.

Liebold: Vinext you could test user.agent?

Hosterman: Volk, maybe the comma in between the last closing brackets

Straight: Volk: JSON doesn’t allow trailing commas. you should NEVER hand-write JSON – use a proper serializer function/lib to do that.

Volk: Ok, the JSON i shared is a small snippet of the full amount of data

Sowders: I write JSON by hand all the time. if it’s about 40 characters, after that, yeah. use a proper tool.

Volk: The comma isn’t at the end of the last entry i just didn’t keep the 3-30k entries, my mistake

Straight: Volk: what are you using to create the json?

Volk: Straight: populate a leaflet map

Straight: Volk: wait, pastebin the code that’s working with it. it’s likely not the data.

Straight: Zap0: if you want to do that, fine, but don’t let people think it’s a good idea :-

Volk: Straight: http://pastebin.com/HzrBmEiQ

Volk: Making a call to couchbase

Sowders: Getting things done is a good idea. over engineering is a sign of autism.

Straight: Zap0: hand-writing it? no, it’s not. that’s a power-user skill and one that should never be recommended to others. if you’re skilled enough to know when it’s OK, then that’s the only way someone should figure it out.

Kious: Vinex08: Chrome and safari have “safari” in its useragent. but safari only has “safari” in it and chrome has “safari” and “chrome” in it … so test if the useragent contains both – chrome else it’s safari

Straight: A no it’s not, b not hand-writing JSON isn’t “overengineering”, it’s “not stupid engineering”

Straight: Vinex08: what are you trying to achieve by only running a script in safari? do not ever do useragent-sniffing, that’s horrible and brittle.

Straight: Lyze: nobody should be checking the UA for any runtime purpose.

Scherb: Straight: Is there any better way to test if it’s safari?

Straight: Zap0: if it takes you longer to use a tool to produce JSON than to hand-write it, then you probably need to learn how to use one of the available tools better.

Straight: Lyze: yes – never test if it’s safari.

Straight: Lyze: your code should *never* care which browser it’s running on. only what *features* the current browser has.

Straight: Lyze: it’s likely not “safari” they want to check for, it’s “some feature”

Sowders: I have a one off JSON to write, and it’s like 30 characters. you saying i should invest a pile of time and energy into implementing some library to “manage” that?

Straight: Volk: you said the data type is jsonp

Straight: Volk: your first pastebin is JSON, not JSONP.

Parco: Straight: Yeah probably and I wouldn’t do that but I asked because it sounded like a interesting problem

Straight: Volk: JSONP is json, wrapped with a JS function

Straight: Lyze: when someone asks how to cut down a tree with a *****driver, it’s best to give them an axe or a saw before actually trying to figure out how one would do it with a *****driver ;-

Blackshire: Http://pastebin.com/9rJqjqhf ugh this is going to sound really dumb but. why isn’t data.foo set to the result of obj.getProperties if data.foo is an instance of GameObject? I’m supplying data to that recursive function and it’s setting what is supplied as that result, and I’ve checked to make sure that result is what I think it is, but data at the end is not mutated how I expect.

Straight: Volk: i’m not sure why jsonp is set to “false” if dataType is set to jsonp either

Straight: Sadtaco: instanceof Object isn’t really useful

Straight: Sadtaco: but also, JS is p*** by value.

Straight: Sadtaco: direct ***ignment to arguments is *never ever* visible outside of the function

Straight: Sadtaco: you want data = replaceGameObjectsdata and to have the function *return* the replacement.

Laker: I thought there’s cases where you can mutate what’s p***ed. Wonder what I’m thinking of