Skip to content

Commit

Permalink
Merge pull request #889 from Turbo87/ts-fixes
Browse files Browse the repository at this point in the history
Fix type declarations
  • Loading branch information
rwjblue authored Dec 22, 2018
2 parents 483842a + 6cb8187 commit 8ab863c
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions packages/@glimmer/bundle-compiler/test/entry-point-test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { module, test, EagerRenderDelegate } from '@glimmer/test-helpers';
import { module, test, EagerRenderDelegate, RenderTest } from '@glimmer/test-helpers';
import { PrimitiveReference } from '@glimmer/runtime';

export class EntryPointTest {
export class EntryPointTest extends RenderTest {
@test
'an entry point'() {
let delegate = new EagerRenderDelegate();
Expand Down
4 changes: 2 additions & 2 deletions packages/@glimmer/object/test/ember-computed-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ QUnit.test(
QUnit.test(
'Calling _super in call outside the immediate function of a CP getter works',
function() {
function macro(callback: (obj: any) => any) {
function macro(callback: () => any) {
return computed(function(this: any) {
return callback.call(this);
});
Expand All @@ -285,7 +285,7 @@ QUnit.test(
QUnit.test(
'Calling _super in apply outside the immediate function of a CP getter works',
function() {
function macro(callback: (obj: any) => any) {
function macro(callback: () => any) {
return computed(function(this: any) {
return callback.apply(this);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/@glimmer/opcode-compiler/lib/syntax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ export type MissingBlockMacro<Locator> = (
template: Option<CompilableBlock>,
inverse: Option<CompilableBlock>,
builder: OpcodeBuilder<Locator>
) => void;
) => boolean;

export class Blocks {
private names = dict<number>();
Expand Down
4 changes: 2 additions & 2 deletions packages/@glimmer/reference/lib/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ export abstract class CachedTag extends RevisionTag {
private lastValue: Option<Revision> = null;

value(): Revision {
let { lastChecked, lastValue } = this;
let { lastChecked } = this;

if (lastChecked !== $REVISION) {
this.lastChecked = $REVISION;
this.lastValue = lastValue = this.compute();
this.lastValue = this.compute();
}

return this.lastValue as Revision;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ APPEND_OPCODES.add(Op.PushDynamicComponentInstance, vm => {
expectStackChange(vm.stack, 0, 'PushDynamicComponentInstance');
});

APPEND_OPCODES.add(Op.PushCurriedComponent, (vm, { op1: _meta }) => {
APPEND_OPCODES.add(Op.PushCurriedComponent, (vm, {}) => {
let stack = vm.stack;

let component = check(stack.pop(), CheckPathReference).value();
Expand Down
2 changes: 1 addition & 1 deletion packages/@glimmer/runtime/test/updating-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ module('[glimmer-runtime] Updating', hooks => {
let expected: string;

if (typeof _input === 'function') {
input = _input(wrapper.isHTML);
input = (_input as ((isHTML: boolean) => Opaque))(wrapper.isHTML);
} else {
input = _input;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/@glimmer/syntax/lib/traversal/traverse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ function visitNode(visitor: NodeVisitor, node: Node): Node | Node[] | undefined
if (JSON.stringify(node) === JSON.stringify(result)) {
result = undefined;
} else if (Array.isArray(result)) {
return visitArray(visitor, result) || result;
visitArray(visitor, result);
return result;
} else {
return visitNode(visitor, result) || result;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/@glimmer/test-helpers/lib/render-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -824,19 +824,19 @@ export interface RenderDelegateConstructor<
new (env?: TEnvironment): Delegate;
}

export interface RenderTestConstructor<D extends RenderDelegate, T> {
export interface RenderTestConstructor<D extends RenderDelegate, T extends RenderTest> {
new (delegate: D): T;
}

export function module<T>(
export function module<T extends RenderTest>(
name: string,
klass: RenderTestConstructor<RenderDelegate, T>,
options = { componentModule: false }
): void {
return rawModule(name, klass, LazyRenderDelegate, options);
}

export function rawModule<D extends RenderDelegate, T, E extends Environment>(
export function rawModule<D extends RenderDelegate, T extends RenderTest, E extends Environment>(
name: string,
klass: RenderTestConstructor<D, T>,
Delegate: RenderDelegateConstructor<D, E>,
Expand Down

0 comments on commit 8ab863c

Please sign in to comment.