mirror of
https://github.com/liabru/matter-js.git
synced 2025-03-08 23:03:36 -05:00
fix undefined variables, added jshint checks, closes #102
This commit is contained in:
parent
f770a7c586
commit
536e55f496
4 changed files with 20 additions and 4 deletions
15
.jshintrc
15
.jshintrc
|
@ -25,5 +25,18 @@
|
||||||
"sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
|
"sub" : false, // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
|
||||||
"trailing" : false, // Prohibit trailing whitespaces.
|
"trailing" : false, // Prohibit trailing whitespaces.
|
||||||
"white" : false, // Check against strict whitespace and indentation rules.
|
"white" : false, // Check against strict whitespace and indentation rules.
|
||||||
"indent" : 4 // Specify indentation spacing
|
"indent" : 4, // Specify indentation spacing
|
||||||
|
|
||||||
|
// variables
|
||||||
|
"undef": true,
|
||||||
|
"-W079": true, // Silence redefinition errors (they are false positives).
|
||||||
|
"predef": [
|
||||||
|
"Matter", "window", "document", "Element", "MatterTools", "PIXI",
|
||||||
|
"$", "Image", "navigator", "setTimeout", "decomp", "HTMLElement",
|
||||||
|
"Body", "Composite", "World", "Contact", "Detector", "Grid",
|
||||||
|
"Pairs", "Pair", "Resolver", "SAT", "Constraint", "MouseConstraint",
|
||||||
|
"Common", "Engine", "Mouse", "Sleeping", "Bodies", "Composites",
|
||||||
|
"Axes", "Bounds", "Vector", "Vertices", "Render", "RenderPixi",
|
||||||
|
"Events", "Query", "Runner", "Svg", "Metrics"
|
||||||
|
]
|
||||||
}
|
}
|
|
@ -51,6 +51,7 @@ var Resolver = {};
|
||||||
normal,
|
normal,
|
||||||
bodyBtoA,
|
bodyBtoA,
|
||||||
contactShare,
|
contactShare,
|
||||||
|
positionImpulse,
|
||||||
contactCount = {},
|
contactCount = {},
|
||||||
tempA = Vector._temp[0],
|
tempA = Vector._temp[0],
|
||||||
tempB = Vector._temp[1],
|
tempB = Vector._temp[1],
|
||||||
|
|
|
@ -26,7 +26,7 @@ var Svg = {};
|
||||||
var i, il, total, point, segment, segments,
|
var i, il, total, point, segment, segments,
|
||||||
segmentsQueue, lastSegment,
|
segmentsQueue, lastSegment,
|
||||||
lastPoint, segmentIndex, points = [],
|
lastPoint, segmentIndex, points = [],
|
||||||
length = 0, x = 0, y = 0;
|
lx, ly, length = 0, x = 0, y = 0;
|
||||||
|
|
||||||
sampleLength = sampleLength || 15;
|
sampleLength = sampleLength || 15;
|
||||||
|
|
||||||
|
|
|
@ -387,7 +387,8 @@ var Render = {};
|
||||||
options = render.options,
|
options = render.options,
|
||||||
body,
|
body,
|
||||||
part,
|
part,
|
||||||
i;
|
i,
|
||||||
|
k;
|
||||||
|
|
||||||
for (i = 0; i < bodies.length; i++) {
|
for (i = 0; i < bodies.length; i++) {
|
||||||
body = bodies[i];
|
body = bodies[i];
|
||||||
|
@ -684,7 +685,8 @@ var Render = {};
|
||||||
options = render.options,
|
options = render.options,
|
||||||
body,
|
body,
|
||||||
part,
|
part,
|
||||||
i;
|
i,
|
||||||
|
k;
|
||||||
|
|
||||||
c.beginPath();
|
c.beginPath();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue