AnalyticalGraphicsInc/cesium — pull request #1026 by mramato (2013-08-12 14:28:00+00:00)
Title: Fix #893

This fixes #893 by replacing all usage of `typeof x ==='undefined'` and `typeof x !== 'undefined'` with `!defined(x)` and `defined(x)`. While I'm fairly certain I have not introduced any issues (in fact I accidentally fixed at least one, see below) whomever merges this should probably run through the Sandcastle examples again to keep me honest.

I did not change ThirdParty or Sandcastle code, or any code that doesn't use our require system. By everything else in Source and Specs was updated.

I did some performance profiling to ensure that this change has no ill results. The highest I ever saw `defined` in the profiler was 0.25%, and FPS and Spec time remained unchanged between master and this branch. If anyone else would like to so some additional testing, be my guest.

The bug I mentioned above was in GeometryPipeline, though I'm not 100% sure exactly what the change was, it clearly had something to do with a bad if check, I'll have to look more into it.

master
![image](https://f.cloud.github.com/assets/1495196/947787/11e7c9b8-035b-11e3-97be-0b29b1e4c994.png)

This branch
![image](https://f.cloud.github.com/assets/1495196/947759/aeee627c-035a-11e3-86c0-e65879633068.png)

CC @bagnell @shunter @pjcozzi

P.S. Even with regex replace, this was a huge pain in the ass :grinning:, so you're welcome.