to make using jshint convenient

This commit is contained in:
gorhill 2015-03-03 06:09:35 -05:00
parent e899185a95
commit 2acecb30c0

View file

@ -22,13 +22,12 @@
/* jshint bitwise: false, esnext: true, boss: true */ /* jshint bitwise: false, esnext: true, boss: true */
/* global punycode, µBlock */ /* global punycode, µBlock */
// Older Safari throws an exception for const when it's used with 'use strict'.
// 'use strict';
/******************************************************************************/ /******************************************************************************/
µBlock.staticNetFilteringEngine = (function(){ µBlock.staticNetFilteringEngine = (function(){
'use strict';
/******************************************************************************/ /******************************************************************************/
var µb = µBlock; var µb = µBlock;
@ -45,17 +44,17 @@ var µb = µBlock;
// | +---- bit 8-15: unused // | +---- bit 8-15: unused
// +---- bit 15: never use! (to ensure valid unicode character) // +---- bit 15: never use! (to ensure valid unicode character)
const BlockAction = 0 << 0; var BlockAction = 0 << 0;
const AllowAction = 1 << 0; var AllowAction = 1 << 0;
const ToggleAction = BlockAction ^ AllowAction; var ToggleAction = BlockAction ^ AllowAction;
const Important = 1 << 1; var Important = 1 << 1;
const AnyParty = 0 << 2; var AnyParty = 0 << 2;
const FirstParty = 1 << 2; var FirstParty = 1 << 2;
const ThirdParty = 2 << 2; var ThirdParty = 2 << 2;
const AnyType = 1 << 4; var AnyType = 1 << 4;
var typeNameToTypeValue = { var typeNameToTypeValue = {
'stylesheet': 2 << 4, 'stylesheet': 2 << 4,
'image': 3 << 4, 'image': 3 << 4,
@ -80,13 +79,13 @@ var typeOtherValue = typeNameToTypeValue.other;
// The 2 lsb *must* be zeroed // The 2 lsb *must* be zeroed
var allNetRequestTypesBitmap = (1 << (typeOtherValue >>> 4) + 2) - 4; var allNetRequestTypesBitmap = (1 << (typeOtherValue >>> 4) + 2) - 4;
const BlockAnyTypeAnyParty = BlockAction | AnyType | AnyParty; var BlockAnyTypeAnyParty = BlockAction | AnyType | AnyParty;
const BlockAnyType = BlockAction | AnyType; var BlockAnyType = BlockAction | AnyType;
const BlockAnyParty = BlockAction | AnyParty; var BlockAnyParty = BlockAction | AnyParty;
const AllowAnyTypeAnyParty = AllowAction | AnyType | AnyParty; var AllowAnyTypeAnyParty = AllowAction | AnyType | AnyParty;
const AllowAnyType = AllowAction | AnyType; var AllowAnyType = AllowAction | AnyType;
const AllowAnyParty = AllowAction | AnyParty; var AllowAnyParty = AllowAction | AnyParty;
var reHostnameRule = /^[0-9a-z][0-9a-z.-]*[0-9a-z]$/; var reHostnameRule = /^[0-9a-z][0-9a-z.-]*[0-9a-z]$/;
var reURLPostHostnameAnchors = /[\/?#]/; var reURLPostHostnameAnchors = /[\/?#]/;