Sha256: c5fb3f8d49c1fd250673dc3d3648727037865ea3c5b48cdf1a7c13d1f00545da

Contents?: true

Size: 1.27 KB

Versions: 5

Compression:

Stored size: 1.27 KB

Contents

//= require "vendor/ejs"
//= require "vendor/glMatrix"
//= require "prototype/class"
//= require "core/math"
//= require "core/util"
//= require "core/matrix_stack"

// a global debugAssert method that will do nothing in production, and fail if expr is false
// in any other run mode. If msg is given, an error with that message is raised. Otherwise,
// a more generic error is raised.
window.debugAssert = function(expr, msg) {
  if (Jax.environment != "production" && !expr)
  {
    var error = new Error(msg || "debugAssert failed");
    if (error.stack) error = new Error((msg || "debugAssert failed")+"\n\n"+error.stack);
    throw error;
  }
};

// If glMatrixArrayType isn't simply Array, then most browsers (FF, Chrome) have a pretty
// crappy implementation of toString() that actually tells you nothing about the array's
// contents. This makes the #toString method a little more Array-like.
//
// Ex: "[Float32Array: -100,-100,-100]"
if (glMatrixArrayType.prototype.toString != Array.prototype.toString) {
  glMatrixArrayType.prototype.toString = function() {
    var s = "["+glMatrixArrayType.name+": ";
    var d = false;
    for (var i in this) {
      if (parseInt(i) == i) {
        if (d) s += ",";
        s += this[i];
        d = true;
      }
    }
    s += "]";
    return s;
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
jax-0.0.0.5 src/jax/core.js
jax-0.0.0.4 src/jax/core.js
jax-0.0.0.3 src/jax/core.js
jax-0.0.0.2 src/jax/core.js
jax-0.0.0.1 src/jax/core.js