add jslint globals comment

This commit is contained in:
walterhiggins 2015-02-16 22:10:25 +00:00
parent 1f122cb2cb
commit fec318c2a4

View file

@ -1,3 +1,4 @@
/*global nashorn, require, Packages, module*/
var ItemType = Packages.net.canarymod.api.inventory.ItemType; var ItemType = Packages.net.canarymod.api.inventory.ItemType;
var Canary = Packages.net.canarymod.Canary; var Canary = Packages.net.canarymod.Canary;
var itemFactory = Canary.factory().itemFactory; var itemFactory = Canary.factory().itemFactory;
@ -35,13 +36,14 @@ if (nashorn){
*/ */
var itemTypeClass = require('nashorn-type')(ItemType); var itemTypeClass = require('nashorn-type')(ItemType);
var materials = itemTypeClass.getDeclaredFields(); var materials = itemTypeClass.getDeclaredFields();
var name;
for (var i = 0;i < materials.length; i++ ){ for (var i = 0;i < materials.length; i++ ){
if (materials[i].type != itemTypeClass) { if (materials[i].type != itemTypeClass) {
continue; continue;
} }
var materialField = materials[i]; var materialField = materials[i];
var name = (''+materialField.name); name = (''+materialField.name);
name = name.replace(/^(.)/,function(a){ name = name.replace(/^(.)/,function(a){
return a.toLowerCase(); return a.toLowerCase();
}); });
@ -57,7 +59,7 @@ if (nashorn){
if (!(ItemType[field] instanceof ItemType)){ if (!(ItemType[field] instanceof ItemType)){
continue; continue;
} }
var name = (''+field).replace(/^(.)/,function(a){ name = (''+field).replace(/^(.)/,function(a){
return a.toLowerCase(); return a.toLowerCase();
}); });
items[name] = getMaterialHandler(ItemType[field]); items[name] = getMaterialHandler(ItemType[field]);