on master help sign in
updates to webgl, mjs native for strict JS
a428befJohn P Mayer Jr
libraries/Native/Graphics/WebGL.js+1−1
@@ -208,7 +208,7 @@ Elm.Native.Graphics.WebGL.make = function(elm) {
208 var attribute = gl.getActiveAttrib(program, i);
208 var attribute = gl.getActiveAttrib(program, i);
209 var attribLocation = gl.getAttribLocation(program, attribute.name);
209 var attribLocation = gl.getAttribLocation(program, attribute.name);
210 gl.enableVertexAttribArray(attribLocation);
210 gl.enableVertexAttribArray(attribLocation);
211− attributeBuffer = buffer.buffers[attribute.name];
211+ var attributeBuffer = buffer.buffers[attribute.name];
212
212
213 switch (attribute.type) {
213 switch (attribute.type) {
214 case gl.FLOAT_VEC3:
214 case gl.FLOAT_VEC3:
libraries/Native/MJS.js+15−15
@@ -46,7 +46,7 @@ Elm.Native.MJS.make = function(elm) {
46 * mjs version number aa.bb.cc, encoded as an integer of the form:
46 * mjs version number aa.bb.cc, encoded as an integer of the form:
47 * 0xaabbcc.
47 * 0xaabbcc.
48 */
48 */
49− const MJS_VERSION = 0x000000;
49+ var MJS_VERSION = 0x000000;
50
50
51 /*
51 /*
52 * Constant: MJS_DO_ASSERT
52 * Constant: MJS_DO_ASSERT
@@ -56,7 +56,7 @@ Elm.Native.MJS.make = function(elm) {
56 * For potentially more performance, the assert methods can be
56 * For potentially more performance, the assert methods can be
57 * commented out in each place where they are called.
57 * commented out in each place where they are called.
58 */
58 */
59− const MJS_DO_ASSERT = true;
59+ //var MJS_DO_ASSERT = true;
60
60
61 /*
61 /*
62 * Constant: MJS_FLOAT_ARRAY_TYPE
62 * Constant: MJS_FLOAT_ARRAY_TYPE
@@ -68,19 +68,19 @@ Elm.Native.MJS.make = function(elm) {
68 * MJS_FLOAT_ARRAY_TYPE. Also, the builtin constants such as (M4x4.I)
68 * MJS_FLOAT_ARRAY_TYPE. Also, the builtin constants such as (M4x4.I)
69 * will be of this type.
69 * will be of this type.
70 */
70 */
71− //const MJS_FLOAT_ARRAY_TYPE = WebGLFloatArray;
71+ //MJS_FLOAT_ARRAY_TYPE = WebGLFloatArray;
72− const MJS_FLOAT_ARRAY_TYPE = Float32Array;
72+ var MJS_FLOAT_ARRAY_TYPE = Float32Array;
73− //const MJS_FLOAT_ARRAY_TYPE = Float64Array;
73+ //MJS_FLOAT_ARRAY_TYPE = Float64Array;
74− //const MJS_FLOAT_ARRAY_TYPE = Array;
74+ //MJS_FLOAT_ARRAY_TYPE = Array;
75−
75+
76− if (MJS_DO_ASSERT) {
76+ //if (MJS_DO_ASSERT) {
77− function MathUtils_assert(cond, msg) {
77+ //function MathUtils_assert(cond, msg) {
78− if (!cond)
78+ //if (!cond)
79− throw "Assertion failed: " + msg;
79+ //throw "Assertion failed: " + msg;
80− }
80+ //}
81− } else {
81+ //} else {
82− function MathUtils_assert() { }
82+ function MathUtils_assert() { }
83− }
83+ //}
84
84
85 /*
85 /*
86 * Class: V3
86 * Class: V3