ippa / jaws

Jaws - HTML5 canvas javascript 2D Game Framework
https://jawsjs.ippa.se
GNU Lesser General Public License v3.0
363 stars 75 forks source link

Update core.js: Docs, Fixes #87

Closed videlais closed 11 years ago

videlais commented 11 years ago

Changes:

-- Added jaws.isNumber for checking if a value passes !isNaN and isFinite tests.

-- Changed jaws.isString to detect String-like objects

-- jaws.parseOptions now logs an unsupported property instead of throwing an error

-- "Rect" is no longer added to the window during a call to jaws.unpack(). (Conflicts with pre-existing window.Rect reference in some browsers.)

-- "QuadTree" is now added to window during a call to jaws.unpack()

-- jaws.log.useConsole acts as flag for if logging should use the console or not (default false)

-- jaws.log.useLogElement acts as flag for if logging should use the log_tag element or not (default true)

ippa commented 11 years ago

hm, wasn't easily mergable and mergetool was acting up. I ended up just replacing my old core.js with your new, it seemed like you added the last thing I added, the clone-call in parseOptions.

I got some failing tests now though, maybe you could take a look at those.

ippa commented 11 years ago

nice work btw. kinda fun how one can add options as properties to the functions themselves :)

ippa commented 11 years ago

Some small things btw.

Maybe not needed here, but doing: console.log("JawsJS", msg) ..instead of .. console.log("JawsJS: " + msg); ... and msg will be automatically formated like in chrome dev console. the first example does toString(); I know we do JSON.stringify on msg before now..

jaws style-guide says "snake_case" for variables and camelCase for functions. Should fix that for these two: jaws.log.useConsole = false; jaws.log.useLogElement = true;

Easiest if you fix them while you're at it.

videlais commented 11 years ago

@ippa Could you e-mail me which tests it is failing? I'm seeing mixed results (passing in Firefox and Safari, failing in Chrome and Internet Explorer).

If it is related to a cross-domain error I've seen a few times, it might be time to implement that exception handling we talked about the other day.

McFunkypants commented 11 years ago

Hey guys just wanted to say you are both doing an amazing job and I love lurking here, getting emails when new jaws stuff comes in. Thumbs up on exception handling - in particular in the case when urls for assets are malformed or we use a sprite who's image has not yet been downloaded. For me, this always results in a silent hang, but should just draw nothing and keep going. It dies inside a regex related to extracting the file extension - it tried to regex a null.