npm run test
```
dit@dit:~/github/js_facade_gen$ npm run test
> dart_js_facade_gen@0.0.7 test /usr/local/google/home/dit/github/js_facade_gen
> gulp test
[11:40:01] Using gulpfile ~/github/js_facade_gen/gulpfile.js
[11:40:01] Starting 'test'...
[11:40:01] Starting 'checkFormat'...
[11:40:11] Finished 'checkFormat' after 10 s
[11:40:11] Starting 'checkLint'...
[11:40:12] Finished 'checkLint' after 631 ms
[11:40:12] Starting 'test.compile'...
[11:40:12] Starting 'compile'...
[11:40:16] Finished 'compile' after 4.02 s
[11:40:16] Starting ''...
[11:40:20] Finished '' after 3.45 s
[11:40:20] Finished 'test.compile' after 7.47 s
[11:40:20] Starting ''...
calls
✓ translates destructuring parameters (83ms)
✓ suppress calls with literal parameters (59ms)
✓ suppress calls
✓ suppress new calls
✓ suppress "super()" constructor calls
✓ ignore "super.x()" super method calls
✓ suppress new calls without arguments
variables
✓ should print variable declaration with initializer
✓ should print variable declaration
✓ should transpile variable declaration lists
✓ should transpile variable declaration lists with initializers
✓ support vardecls containing more than one type (implicit or explicit) (52ms)
✓ supports const
classes
✓ should translate classes
✓ should support extends
✓ should support implements
✓ should support implements
✓ should support abstract
members
✓ supports empty declarations
✓ supports fields (46ms)
✓ supports function typed fields
✓ supports field initializers
✓ supports visibility modifiers (57ms)
✓ allow protected
✓ supports static fields
✓ supports methods
✓ should emit extension methods to return Futures from methods that return Promises (126ms)
✓ supports abstract methods
✓ supports method return types
✓ supports method params
✓ supports method return types
✓ supports get methods
✓ supports set methods
✓ supports constructors
✓ supports parameter properties
✓ should emit extension getters/setters that expose Futures in place of Promises (41ms)
interfaces
✓ translates interfaces to abstract classes
✓ translates interface extends to class implements
✓ supports abstract methods
✓ supports interface properties
✓ should emit extension methods to return Futures from methods that return Promises (43ms)
✓ handles interface properties with names that are invalid in Dart (59ms)
types with constructors
✓ should merge variables and interfaces with the same name by default
supports type literals with constructors
✓ simple
✓ should make members of the literal type static (38ms)
✓ when possible, should merge the variable with an existing type of the same name (40ms)
✓ should support named type aliases of literals
✓ supports declarations within namespaces
supports interfaces with constructors
✓ simple
✓ should make members declared on the interface static
✓ should support type aliases
✓ supports being declared within a namespace
cases where a type and a variable cannot be merged
✓ should handle cases where an interface has no matching variable
flags
✓ does not compile DOM library files when the --generate-html flag is set
emitting properties of top level variables with anonymous types as static
✓ performs this by default
✓ but not when the --explicit-static flag is set
--trust-js-types
✓ makes classes that have neither constructors nor static members anonymous when set
--rename-conflicting-types
✓ should merge variables and interfaces with the same name by default
✓ should rename types that conflict with unrelated variables when the flag is set
single call signature interfaces
✓ should support declaration
✓ should support generics
enums
✓ should support basic enum declaration
✓ allow empty enum
✓ enum with initializer
✓ should ingore switch
✓ does not support const enum
ignore decorators
✓ translates plain decorators
✓ ignore plain decorators applied to abstract classes
✓ translates arguments
✓ translates const arguments
✓ translates on functions
✓ translates on properties
✓ translates on parameters
✓ ignore special cases @CONST (65ms)
ignore expressions
✓ math (87ms)
✓ assigns (108ms)
✓ compares (70ms)
✓ compares identity (43ms)
✓ bit fiddles (83ms)
✓ translates logic (50ms)
✓ translates ternary
✓ translates the comma operator
✓ translates "in"
✓ translates "instanceof"
✓ translates "this"
✓ translates "delete"
✓ translates "typeof"
✓ translates "void"
✓ translates parens
✓ translates property paths
type based translation
✓ translates array façades
✓ translates readonly array façades
Dart type substitution
✓ allows undeclared types
finds registered substitutions
✓ for dart:html types by default
✓ but does not import dart:html types when the flag is set
✓ finds other registered type substitutions (86ms)
skip top level calls
✓ console.log
const
✓ simple (45ms)
readonly
✓ simple
error detection
✓ supports imports
special identifiers
✓ always renames identifiers that are reserved keywords in Dart
✓ only renames built-in keywords when they are used as class or type names (86ms)
✓ preserves names that begin with two underscores
✓ preserves names that begin with one underscore
functions
✓ supports declarations
✓ hide param default values
✓ translates optional parameters
✓ supports empty returns
✓ supports type predicates
✓ polyfill var args
✓ supports function parameters
✓ supports recursive function parameters
✓ supports generic-typed function parameters
✓ translates functions taking rest parameters to untyped Function
generic functions
✓ supports generic types
✓ replaces type usage sites, but not idents
✓ translates generic calls
variables
✓ should print variable declaration
✓ should transpile variable declaration lists
✓ support vardecls containing more than one type (implicit or explicit)
✓ supports const (41ms)
classes
✓ should translate classes
✓ should support extends
✓ should support implements
✓ should support implements
✓ should support abstract
members
✓ supports empty declarations
✓ supports fields
✓ ignore field initializers
✓ supports visibility modifiers (48ms)
✓ does not support protected
✓ supports static fields
✓ supports methods
✓ supports abstract methods
✓ supports method return types
✓ supports method params
✓ supports method return types
✓ supports get methods
✓ supports set methods
✓ supports generic methods
✓ merge overrides (167ms)
✓ dot dot dot
✓ property bag interfaces
✓ callable
✓ supports constructors
✓ supports parameter properties
interfaces
✓ translates interfaces to abstract classes
✓ translates interface extends to class implements
✓ supports abstract methods
✓ supports interface properties
single call signature interfaces
✓ should support declaration
✓ should support generics
enums
✓ should support basic enum declaration
✓ empty enum
✓ enum with initializer
renames
✓ should support class renames (40ms)
✓ should support member renames
✓ handle class renames in type declarations
✓ union types
✓ callback this type
type alias
✓ replace with simple type
main transpiler functionality
comments
✓ keeps leading comments
✓ keeps ctor comments
✓ translates links to dart doc format
✓ removes @module doc tags
✓ removes @description doc tags
✓ removes @depracted doc tags
✓ removes @param doc tags
✓ removes @return doc tags
✓ removes @throws doc tags
✓ multiple line comment
✓ multiple line comment
output paths
✓ writes within the path
✓ defaults to writing to the same location
✓ translates .es6, .ts, and .js
imports
✓ ignore import equals statements
✓ ignore import from statements
✓ ignore import star
✓ ignore renamed imports
✓ empty import spec generates safe Dart code
exports
✓ allows variable exports
✓ allows class exports
✓ allows export declarations
✓ allows export declarations
✓ allows named export declarations
✓ ignores named export declarations
✓ fails for renamed exports
✓ fails for exports without URLs
✓ fails for empty export specs
module name
✓ adds module name
✓ leaves relative paths alone
✓ handles reserved words
✓ handles built-in and limited keywords
✓ handles file extensions
✓ handles non word characters
types
✓ supports qualified names
✓ supports null types (40ms)
✓ supports this return type
✓ supports true and false return types
✓ comment type literals
✓ do not translates string index signatures to dartisms
✓ drops type literals with index signatures and other properties
✓ should support union types (49ms)
✓ should support intersection types
✓ should support parenthesized types (44ms)
✓ should support array types
✓ should support function types
✓ should support conditional types
TypeScript utility types and other mapped types
✓ emits X in place of Partial since all Dart types are currently nullable
✓ treats other mapped types as dynamic
type arguments
✓ should support declaration
✓ should support nested extends
✓ should multiple extends
✓ should support use
✓ should handle and generic arguments (56ms)
✓ should create class for type alias literals
✓ should create typedef for type alias function literals
✓ should handle generic parameters on non dart compatible type aliases
✓ supports the keyof operator and the indexed access operator
merging variables with types
upgrading variables whose types contain construct signatures
✓ supports type literals with construct signatures
✓ supports interfaces with construct signatures
✓ makes members of the type static in the upgraded class by default
✓ does not make members of the type static when the --explicit-static flag is set
merging variables with types based on their names
✓ merges variables with types if they have the exact same name by default
imports and exports
✓ converts export declarations
✓ converts the export modifier
✓ converts import declarations
module declarations
✓ converts module declarations
✓ converts nested module declarations
classes
✓ supports class declarations
✓ supports abstract classes
heritage clauses
✓ supports implements
✓ supports extends
✓ supports classes with both heritage clauses
type parameters
✓ should handle basic cases
✓ should handle type parameters with constraints
members
✓ ignores the semicolon class element
✓ supports properties
✓ supports methods
✓ supports abstract methods
✓ supports getters
✓ supports setters
✓ supports constructors
✓ supports private
✓ supports protected
✓ supports optional
✓ supports readonly
✓ supports static
✓ supports parameter properties
interfaces
✓ supports interface declarations
heritage clauses
✓ supports extends
type parameters
✓ should handle basic cases
✓ should handle type parameters with constraints
members
✓ supports properties
✓ supports methods
✓ supports abstract methods
✓ supports optional
✓ supports readonly
✓ supports call signatures
✓ supports construct signatures
variables
variable declarations
✓ supports declare var
✓ supports declare let
✓ supports declare const
✓ supports lines with multiple declarations
✓ supports untyped variables
265 passing (5s)
[11:40:26] Finished '' after 6.43 s
[11:40:26] Finished 'test' after 25 s
```
This is a small change required to publish a new 0.0.7 version to npm, so people can directly grab the Latest And Greatest.
Fixes https://github.com/dart-lang/js_facade_gen/issues/74
npm run test
``` dit@dit:~/github/js_facade_gen$ npm run test > dart_js_facade_gen@0.0.7 test /usr/local/google/home/dit/github/js_facade_gen > gulp test [11:40:01] Using gulpfile ~/github/js_facade_gen/gulpfile.js [11:40:01] Starting 'test'... [11:40:01] Starting 'checkFormat'... [11:40:11] Finished 'checkFormat' after 10 s [11:40:11] Starting 'checkLint'... [11:40:12] Finished 'checkLint' after 631 ms [11:40:12] Starting 'test.compile'... [11:40:12] Starting 'compile'... [11:40:16] Finished 'compile' after 4.02 s [11:40:16] Starting '