Skip to content

Commit

Permalink
Update dependencies and fix new lint issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
jjrv committed Dec 6, 2016
1 parent 3c81065 commit 1ff756b
Show file tree
Hide file tree
Showing 17 changed files with 96 additions and 104 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"autogypi": "~0.2.2",
"cbuild": "~0.1.1",
"node-gyp": "^3.4.0",
"tap": "^8.0.0",
"tslint": "^3.15.1",
"typescript": "^2.0.8"
"tap": "^8.0.1",
"tslint": "^4.0.2",
"typescript": "^2.0.10"
}
}
4 changes: 2 additions & 2 deletions src/Type.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file is part of nbind, copyright (C) 2014-2016 BusFaster Ltd.
// Released under the MIT license, see LICENSE.

export var {
export const {
Type, makeType, structureList
} = typeModule(typeModule);

Expand Down Expand Up @@ -94,7 +94,7 @@ export const enum StateFlags {
none = 0,

isPersistent = 1,
isDeleted = 2,
isDeleted = 2
}

// These must match C++ enum StructureType in TypeID.h
Expand Down
22 changes: 11 additions & 11 deletions src/em/BindClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ import {TypeFlags, TypeSpecWithName, TypeSpecWithParam, PolicyTbl} from '../Type
setEvil((code: string) => eval(code));

export namespace _nbind {
export var BindType = _type.BindType;
export var Wrapper = _wrapper.Wrapper;
export const BindType = _type.BindType;
export const Wrapper = _wrapper.Wrapper;
}

export namespace _nbind {

export var addMethod: typeof _globals.addMethod;
export var getType: typeof _globals.getType;
export let addMethod: typeof _globals.addMethod;
export let getType: typeof _globals.getType;

export var pushValue: typeof _value.pushValue;
export var popValue: typeof _value.popValue;
export let pushValue: typeof _value.pushValue;
export let popValue: typeof _value.popValue;

export var resources: typeof _resource.resources;
export let resources: typeof _resource.resources;

export var makeCaller: typeof _caller.makeCaller;
export var makeMethodCaller: typeof _caller.makeMethodCaller;
export let makeCaller: typeof _caller.makeCaller;
export let makeMethodCaller: typeof _caller.makeMethodCaller;

type Wrapper = _wrapper.Wrapper;
export var makeBound: typeof _wrapper.makeBound;
export let makeBound: typeof _wrapper.makeBound;

// Any subtype (not instance but type) of Wrapper.
// Declared as anything that constructs something compatible with Wrapper.
Expand All @@ -46,7 +46,7 @@ export namespace _nbind {

export const ptrMarker = {};

export var callUpcast: (upcast: number, ptr: number) => number;
export let callUpcast: (upcast: number, ptr: number) => number;

export interface MethodSpec {
name: string;
Expand Down
6 changes: 3 additions & 3 deletions src/em/BindingStd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ import {TypeSpecWithParam, PolicyTbl} from '../Type';
setEvil((code: string) => eval(code));

export namespace _nbind {
export var Pool = _globals.Pool;
export var BindType = _type.BindType;
export const Pool = _globals.Pool;
export const BindType = _type.BindType;
}

export namespace _nbind {

export var resources: typeof _resource.resources;
export let resources: typeof _resource.resources;

export function pushArray(arr: any[], type: ArrayType) {
if(!arr) return(0);
Expand Down
4 changes: 2 additions & 2 deletions src/em/BindingType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ export namespace _nbind {

export const { Type, makeType, getComplexType } = _typeModule(_typeModule);

export var Pool: typeof _globals.Pool;
export let Pool: typeof _globals.Pool;

export var resources: typeof _resource.resources;
export let resources: typeof _resource.resources;

// A type definition, which registers itself upon construction.

Expand Down
10 changes: 5 additions & 5 deletions src/em/Buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ import {PolicyTbl} from '../Type';
setEvil((code: string) => eval(code));

export namespace _nbind {
export var Pool = _globals.Pool;
export var BindType = _type.BindType;
export var External = _external.External;
export const Pool = _globals.Pool;
export const BindType = _type.BindType;
export const External = _external.External;
}

export namespace _nbind {

export var externalList: typeof _external.externalList;
export let externalList: typeof _external.externalList;

export var resources: typeof _resource.resources;
export let resources: typeof _resource.resources;

class ExternalBuffer extends External<
number[] | ArrayBuffer | DataView | Uint8Array | Buffer
Expand Down
12 changes: 6 additions & 6 deletions src/em/Callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ import {_nbind as _external} from './External';
setEvil((code: string) => eval(code));

export namespace _nbind {
export var BindType = _type.BindType;
export var External = _external.External;
export const BindType = _type.BindType;
export const External = _external.External;
}

export namespace _nbind {

export var readTypeIdList: typeof _globals.readTypeIdList;
export var throwError: typeof _globals.throwError;
export let readTypeIdList: typeof _globals.readTypeIdList;
export let throwError: typeof _globals.throwError;

export var makeJSCaller: typeof _caller.makeJSCaller;
export let makeJSCaller: typeof _caller.makeJSCaller;

// List of invoker functions for all argument and return value combinations
// seen so far.

export var callbackSignatureList: _globals.Func[] = [];
export let callbackSignatureList: _globals.Func[] = [];

export class CallbackType extends BindType {
wireWrite = (func: _globals.Func) => {
Expand Down
12 changes: 6 additions & 6 deletions src/em/Caller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ export namespace _nbind {
type FuncList = _globals.FuncList;
type TypeIdList = _globals.TypeIdList;

export var getTypes: typeof _globals.getTypes;
export var getDynCall: typeof _globals.getDynCall;
export let getTypes: typeof _globals.getTypes;
export let getDynCall: typeof _globals.getDynCall;

export var pushPointer: typeof _class.pushPointer;
export let pushPointer: typeof _class.pushPointer;

export var externalList: _external.External<any>[];
export let externalList: _external.External<any>[];

export var listResources: typeof _resource.listResources;
export var resources: typeof _resource.resources;
export let listResources: typeof _resource.listResources;
export let resources: typeof _resource.resources;

/** Make a list of argument names a1, a2, a3...
* for dynamically generating function source code. */
Expand Down
4 changes: 2 additions & 2 deletions src/em/External.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {_nbind as _type} from './BindingType';
setEvil((code: string) => eval(code));

export namespace _nbind {
export var BindType = _type.BindType;
export const BindType = _type.BindType;
}

export namespace _nbind {
Expand All @@ -28,7 +28,7 @@ export namespace _nbind {
// The first element is a dummy value just so that a valid index to
// the list always tests as true (useful for the free list implementation).

export var externalList: (External<any> | number)[] = [0];
export let externalList: (External<any> | number)[] = [0];

// Head of free list for recycling available slots in the externals list.
let firstFreeExternal = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/em/GC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export namespace _nbind {
}

// tslint:disable-next-line:no-empty
export var mark = (obj: Wrapper) => {};
export let mark = (obj: Wrapper) => {};

export function toggleLightGC(enable: boolean) {
if(enable) {
Expand Down
16 changes: 8 additions & 8 deletions src/em/Globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ export namespace _nbind {
export type Invoker = (ptr: number, ...args: any[]) => any;
export type TypeIdList = (number | string)[];

export var BindType: typeof _type.BindType;
export var getComplexType: typeof _type.getComplexType;
export let BindType: typeof _type.BindType;
export let getComplexType: typeof _type.getComplexType;

export var resources: typeof _resource.resources;
export var listResources: typeof _resource.listResources;
export let resources: typeof _resource.resources;
export let listResources: typeof _resource.listResources;

export var makeOverloader: typeof _caller.makeOverloader;
export let makeOverloader: typeof _caller.makeOverloader;

// Mapping from numeric typeIDs and type names to objects with type information.

Expand Down Expand Up @@ -77,8 +77,8 @@ export namespace _nbind {
}

type TypeConstructor = { new(spec: TypeSpecWithName): _type.BindType };
export var makeTypeKindTbl: { [flags: number]: TypeConstructor };
export var makeTypeNameTbl: { [name: string]: TypeConstructor };
export let makeTypeKindTbl: { [flags: number]: TypeConstructor };
export let makeTypeNameTbl: { [name: string]: TypeConstructor };

export function constructType(kind: TypeFlags, spec: TypeSpecWithName) {
const construct = (
Expand Down Expand Up @@ -224,7 +224,7 @@ export namespace _nbind {
throw(new Error(message));
}

export var bigEndian = false;
export let bigEndian = false;

// Export the namespace to Emscripten compiled output.
// This must be at the end of the namespace!
Expand Down
2 changes: 1 addition & 1 deletion src/em/Resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export namespace _nbind {
return(result);
}

export var resources = {
export const resources = {
pool: new Resource(
'var used=HEAPU32[_nbind.Pool.usedPtr],page=HEAPU32[_nbind.Pool.pagePtr];',
'_nbind.Pool.lreset(used,page);'
Expand Down
10 changes: 5 additions & 5 deletions src/em/ValueObj.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ setEvil((code: string) => eval(code));
const _defineHidden = defineHidden;

export namespace _nbind {
export var BindType = _type.BindType;
export const BindType = _type.BindType;
}

export namespace _nbind {

export var popShared: typeof _class.popShared;
export let popShared: typeof _class.popShared;
type BindClassPtr = _class.BindClassPtr;

export var throwError: typeof _globals.throwError;
export var typeNameTbl: typeof _globals.typeNameTbl;
export var bigEndian: typeof _globals.bigEndian;
export let throwError: typeof _globals.throwError;
export let typeNameTbl: typeof _globals.typeNameTbl;
export let bigEndian: typeof _globals.bigEndian;

export interface ValueObject {
fromJS(output: (...args: any[]) => void): void;
Expand Down
4 changes: 2 additions & 2 deletions src/em/Wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const _defineHidden = defineHidden;

export namespace _nbind {

export var ptrMarker: typeof _class.ptrMarker;
export let ptrMarker: typeof _class.ptrMarker;

export var mark: typeof _gc.mark;
export let mark: typeof _gc.mark;

/** Base class for wrapped instances of bound C++ classes.
* Note that some hacks avoid ever constructing this,
Expand Down
72 changes: 35 additions & 37 deletions src/em/em-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,51 +30,49 @@ import {typeModule, TypeFlags, TypeSpecWithName} from '../Type';
setEvil((code: string) => eval(code));

const _removeAccessorPrefix = removeAccessorPrefix;

// tslint:disable-next-line:no-unused-variable
const _typeModule = typeModule;

export namespace _nbind {
export var Pool: typeof _globals.Pool;
export var bigEndian: typeof _globals.bigEndian;
export let Pool: typeof _globals.Pool;
export let bigEndian: typeof _globals.bigEndian;

export var readTypeIdList: typeof _globals.readTypeIdList;
export var readAsciiString: typeof _globals.readAsciiString;
export var readPolicyList: typeof _globals.readPolicyList;
export var makeTypeKindTbl: typeof _globals.makeTypeKindTbl;
export var makeTypeNameTbl: typeof _globals.makeTypeNameTbl;
export var constructType: typeof _globals.constructType;
export var getType: typeof _globals.getType;
export var queryType: typeof _globals.queryType;
export let readTypeIdList: typeof _globals.readTypeIdList;
export let readAsciiString: typeof _globals.readAsciiString;
export let readPolicyList: typeof _globals.readPolicyList;
export let makeTypeKindTbl: typeof _globals.makeTypeKindTbl;
export let makeTypeNameTbl: typeof _globals.makeTypeNameTbl;
export let constructType: typeof _globals.constructType;
export let getType: typeof _globals.getType;
export let queryType: typeof _globals.queryType;

export var makeType: typeof _type.makeType;
export var getComplexType: typeof _type.getComplexType;
export var BindType: typeof _type.BindType;
export var PrimitiveType: typeof _type.PrimitiveType;
export var BooleanType: typeof _type.BooleanType;
export var CStringType: typeof _type.CStringType;
export let makeType: typeof _type.makeType;
export let getComplexType: typeof _type.getComplexType;
export let BindType: typeof _type.BindType;
export let PrimitiveType: typeof _type.PrimitiveType;
export let BooleanType: typeof _type.BooleanType;
export let CStringType: typeof _type.CStringType;

export var BindClass: typeof _class.BindClass;
export var BindClassPtr: typeof _class.BindClassPtr;
export var SharedClassPtr: typeof _class.BindClassPtr;
export var callUpcast: typeof _class.callUpcast;
export let BindClass: typeof _class.BindClass;
export let BindClassPtr: typeof _class.BindClassPtr;
export let SharedClassPtr: typeof _class.BindClassPtr;
export let callUpcast: typeof _class.callUpcast;

export var ExternalType: typeof _external.ExternalType;
export let ExternalType: typeof _external.ExternalType;

export var CallbackType: typeof _callback.CallbackType;
export let CallbackType: typeof _callback.CallbackType;

export var CreateValueType: typeof _value.CreateValueType;
export var Int64Type: typeof _value.Int64Type;
export var popValue: typeof _value.popValue;
export let CreateValueType: typeof _value.CreateValueType;
export let Int64Type: typeof _value.Int64Type;
export let popValue: typeof _value.popValue;

export var ArrayType: typeof _std.ArrayType;
export var StringType: typeof _std.StringType;
export let ArrayType: typeof _std.ArrayType;
export let StringType: typeof _std.StringType;

export var makeMethodCaller: typeof _caller.makeMethodCaller;
export let makeMethodCaller: typeof _caller.makeMethodCaller;

export var BufferType: typeof _buffer.BufferType;
export let BufferType: typeof _buffer.BufferType;

export var toggleLightGC: typeof _gc.toggleLightGC;
export let toggleLightGC: typeof _gc.toggleLightGC;
}

publishNamespace('_nbind');
Expand Down Expand Up @@ -114,13 +112,13 @@ class nbind { // tslint:disable-line:class-name
};

_nbind.makeTypeNameTbl = {
'bool': _nbind.BooleanType,
'cbFunction &': _nbind.CallbackType,
'std::string': _nbind.StringType,
'External': _nbind.ExternalType,
'Buffer': _nbind.BufferType,
'External': _nbind.ExternalType,
'Int64': _nbind.Int64Type,
'_nbind_new': _nbind.CreateValueType
'_nbind_new': _nbind.CreateValueType,
'bool': _nbind.BooleanType,
'cbFunction &': _nbind.CallbackType,
'std::string': _nbind.StringType
};

Module['toggleLightGC'] = _nbind.toggleLightGC;
Expand Down
Loading

0 comments on commit 1ff756b

Please sign in to comment.