├── .gitmodules ├── library └── plugins │ ├── traceur-compiler │ ├── test │ │ ├── wiki │ │ │ ├── .gitignore │ │ │ └── CompilingOffline │ │ │ │ ├── greeter.js │ │ │ │ └── UsingCompiledFiles.html │ │ ├── feature │ │ │ ├── Syntax │ │ │ │ ├── Empty.js │ │ │ │ ├── null.js │ │ │ │ ├── RegularExpression.js │ │ │ │ ├── ImplicitSemiColon.js │ │ │ │ ├── Error_RegExpNotClosed.js │ │ │ │ ├── UnicodeEscapeSequenceInName.js │ │ │ │ ├── Error_Arguments.js │ │ │ │ ├── Error_FunctionParam.js │ │ │ │ ├── Error_WithInModule.module.js │ │ │ │ ├── Error_NoLineTerminatorPostfix.js │ │ │ │ ├── Error_YieldStarNewLine.js │ │ │ │ ├── Error_UnicodeEscapeSequenceInName.js │ │ │ │ ├── Error_WithInStrictProgram.js │ │ │ │ ├── Error_WithInClass.js │ │ │ │ ├── NumberLiteralMemberExpression.js │ │ │ │ ├── UseStrictEscapeSequence.js │ │ │ │ ├── UseStrictLineContinuation.js │ │ │ │ ├── Error_StrictKeywordsInStrict.js │ │ │ │ ├── Error_StrictKeywordsInArguments.js │ │ │ │ ├── Error_StrictKeywordsInArgumentsPattern.js │ │ │ │ ├── Error_WithInStrictFunction.js │ │ │ │ ├── ArrayWithHoles.js │ │ │ │ ├── Error_StrictKeywordsInPropertyDefinitionIdentifierReference.js │ │ │ │ ├── StringEscapes.js │ │ │ │ └── ExpressionValidation.js │ │ │ ├── Modules │ │ │ │ ├── resources │ │ │ │ │ ├── a.js │ │ │ │ │ ├── c.js │ │ │ │ │ ├── x.js │ │ │ │ │ ├── a2.js │ │ │ │ │ ├── b.js │ │ │ │ │ ├── d.js │ │ │ │ │ ├── default.js │ │ │ │ │ ├── f.js │ │ │ │ │ ├── side-effect.js │ │ │ │ │ ├── m2.js │ │ │ │ │ ├── side-effect2.js │ │ │ │ │ ├── m.js │ │ │ │ │ ├── n.js │ │ │ │ │ ├── default-name.js │ │ │ │ │ ├── m3.js │ │ │ │ │ ├── o.js │ │ │ │ │ ├── i.js │ │ │ │ │ ├── export-conflict.js │ │ │ │ │ ├── default-class.js │ │ │ │ │ ├── TestClass.js │ │ │ │ │ └── clockwise.js │ │ │ │ ├── EmptyNamedImport.js │ │ │ │ ├── ImportAsExportAs.js │ │ │ │ ├── ModuleName.module.js │ │ │ │ ├── ModuleDefault.js │ │ │ │ ├── StaticMethod.js │ │ │ │ ├── ThisInModules.js │ │ │ │ ├── Error_ExportKeyword.module.js │ │ │ │ ├── Error_ModuleNoNewline.js │ │ │ │ ├── Error_ExportKeyword2.module.js │ │ │ │ ├── Error_InvalidExport.module.js │ │ │ │ ├── Error_InvalidModuleDeclaration2.js │ │ │ │ ├── ImportNoImportClause.js │ │ │ │ ├── Error_InvalidExport2.module.js │ │ │ │ ├── ExportStar.js │ │ │ │ ├── ImportEmptyImportClause.js │ │ │ │ ├── Error_ImportStar.js │ │ │ │ ├── Error_ImportDefault.js │ │ │ │ ├── Error_InvalidExport3.module.js │ │ │ │ ├── ImportDefault.js │ │ │ │ ├── ModuleNoNewline.js │ │ │ │ ├── Error_ExportStarConflict.js │ │ │ │ ├── ImportCircular.module.js │ │ │ │ ├── Error_ExportStarDuplicateExport.module.js │ │ │ │ ├── Error_MissingExport.js │ │ │ │ ├── Exports.js │ │ │ │ ├── ImportFromModule.js │ │ │ │ └── Error_InvalidModuleDeclaration.js │ │ │ ├── Classes │ │ │ │ ├── SemiColon.js │ │ │ │ ├── Error_Disabled.js │ │ │ │ ├── ExtendObject.js │ │ │ │ ├── StaticSymbol.js │ │ │ │ ├── DeriveFromObject.js │ │ │ │ ├── Error_Super.js │ │ │ │ ├── Error_SuperAsTemplateTag.js │ │ │ │ ├── PrototypeDescriptor.js │ │ │ │ ├── ExtendNonConstructableFunction.js │ │ │ │ ├── SuperWithoutExtends.js │ │ │ │ ├── NewClassExpression.js │ │ │ │ ├── InheritanceNameBinding.js │ │ │ │ ├── Inheritance.js │ │ │ │ ├── RestParams.js │ │ │ │ ├── SuperChangeProto.js │ │ │ │ ├── Types.js │ │ │ │ ├── SuperPostfix.js │ │ │ │ ├── Fields.js │ │ │ │ ├── InheritanceFromNonclass.js │ │ │ │ ├── OptionalParams.js │ │ │ │ ├── Getters.js │ │ │ │ ├── ConstructorChaining.js │ │ │ │ ├── FieldInitializers.js │ │ │ │ ├── Method.js │ │ │ │ ├── SuperUnary.js │ │ │ │ ├── SuperChaining.js │ │ │ │ └── Skip_HTMLBlockquoteElement.js │ │ │ ├── TemplateLiterals │ │ │ │ ├── resources │ │ │ │ │ ├── f.js │ │ │ │ │ ├── m.js │ │ │ │ │ └── n.js │ │ │ │ ├── InModule.js │ │ │ │ ├── Error_NotClosed.js │ │ │ │ ├── Error_InvalidSubstitution.js │ │ │ │ ├── Error_InvalidSubstitution2.js │ │ │ │ ├── Strict.js │ │ │ │ ├── InBlock.js │ │ │ │ ├── Error_Disabled.js │ │ │ │ ├── CommaExpression.js │ │ │ │ ├── StringRaw.js │ │ │ │ ├── CallExpression.js │ │ │ │ └── MemberExpression.js │ │ │ ├── ObjectInitialiserShorthand │ │ │ │ ├── Error_Keyword.js │ │ │ │ ├── Error_Disabled.js │ │ │ │ ├── Error_MissingVar.js │ │ │ │ └── Ok.js │ │ │ ├── Rest │ │ │ │ ├── Strict.js │ │ │ │ ├── Error_SetAccessor.js │ │ │ │ ├── Error_NotLast.js │ │ │ │ └── Simple.js │ │ │ ├── Spread │ │ │ │ ├── Error_Disabled.js │ │ │ │ ├── CallWithUndefined.js │ │ │ │ ├── Call.js │ │ │ │ ├── NewBuiltin.js │ │ │ │ ├── Array.js │ │ │ │ ├── MethodCall.js │ │ │ │ ├── New.js │ │ │ │ ├── MethodCallQuotedName.js │ │ │ │ ├── Class.js │ │ │ │ └── New2.js │ │ │ ├── Yield │ │ │ │ ├── Error_MissingStar.js │ │ │ │ ├── DefaultArguments.js │ │ │ │ ├── EmptyGenerator.js │ │ │ │ ├── This.js │ │ │ │ ├── Error_Disabled2.js │ │ │ │ ├── Arguments.js │ │ │ │ ├── Error_Disabled.js │ │ │ │ ├── GeneratorWithoutYieldOrReturn.js │ │ │ │ ├── CommaOperator.js │ │ │ │ ├── BinaryOperator.js │ │ │ │ ├── LabelledBlockGenerator.js │ │ │ │ ├── ReturnYieldFor.js │ │ │ │ ├── IfStatementWithYield.js │ │ │ │ ├── SimpleGenerator.js │ │ │ │ ├── ForEmptyGenerator.js │ │ │ │ ├── Continue.js │ │ │ │ ├── DoGenerator.js │ │ │ │ ├── YieldAssignThrow.js │ │ │ │ ├── ForLexicallyNestedGenerator.js │ │ │ │ ├── Finally.js │ │ │ │ ├── SequenceGenerator.js │ │ │ │ ├── TryCatchYieldGenerator.js │ │ │ │ ├── YieldIdentifier.js │ │ │ │ ├── YieldYield.js │ │ │ │ ├── ForInGenerator3.js │ │ │ │ ├── IfGenerator.js │ │ │ │ ├── WhileGenerator.js │ │ │ │ ├── ForInGenerator.js │ │ │ │ ├── SwitchStatementWithYield.js │ │ │ │ ├── YieldUndefinedGenerator.js │ │ │ │ ├── ForGenerator.js │ │ │ │ └── ForInGenerator2.js │ │ │ ├── ArrowFunctions │ │ │ │ ├── Error_FreeVariableChecker.js │ │ │ │ ├── Error_CoverInitialiser2.js │ │ │ │ ├── FreeVariableChecker.js │ │ │ │ ├── Error_Disabled.js │ │ │ │ ├── Arguments.js │ │ │ │ ├── Error_SpreadOutsideFormals.js │ │ │ │ ├── Error_Precedence.js │ │ │ │ ├── Error_InvalidFormalParameters.js │ │ │ │ ├── CoverInitialiser.js │ │ │ │ ├── Error_Precedence3.js │ │ │ │ ├── Error_CoverInitialiser.js │ │ │ │ ├── Error_Precedence2.js │ │ │ │ ├── Error_SpreadNotLast.js │ │ │ │ ├── AlphaRename.js │ │ │ │ ├── Skip_SoftBind.js │ │ │ │ ├── ThisBindings.js │ │ │ │ └── Skip_InitialiserShorthand.js │ │ │ ├── Destructuring │ │ │ │ ├── DefaultParams.js │ │ │ │ ├── Error_Disabled.js │ │ │ │ ├── Strict.js │ │ │ │ ├── Error_InvalidCoverInitialisedName.js │ │ │ │ ├── Error_InvalidArrowRest.js │ │ │ │ ├── FunctionObjectPattern.js │ │ │ │ ├── Error_ForInWithInitializer.js │ │ │ │ ├── Error_Catch.js │ │ │ │ ├── Error_ForOfWithInitializer.js │ │ │ │ ├── Method.js │ │ │ │ ├── SetAccessor.js │ │ │ │ ├── Arguments.js │ │ │ │ ├── EvaluatesToRvalue.js │ │ │ │ ├── EvaluationOrder.js │ │ │ │ ├── TopLevel.js │ │ │ │ ├── FunctionArrayPattern.js │ │ │ │ ├── ScopeThis.js │ │ │ │ ├── Empty.js │ │ │ │ ├── NestedScopeArguments.js │ │ │ │ ├── ArrowFunction.js │ │ │ │ ├── Catch.js │ │ │ │ ├── Rest.js │ │ │ │ ├── Array.js │ │ │ │ └── ForOfLoop.js │ │ │ ├── Scope │ │ │ │ ├── Error_Disabled.js │ │ │ │ ├── Error_ForInWithInitializerLet.js │ │ │ │ ├── Error_ConstMissingInitializer.js │ │ │ │ ├── LetNoInitializerGlobal.js │ │ │ │ ├── Error_ForWithoutInitializerConst.js │ │ │ │ ├── ForInWithInitializerVar.js │ │ │ │ ├── Error_ForOfWithInitializerLet.js │ │ │ │ ├── Error_ForOfWithInitializerVar.js │ │ │ │ ├── NameBindingInFunction.js │ │ │ │ ├── TopLevelLet.js │ │ │ │ ├── Error_ForOfWithInitializerConst.js │ │ │ │ ├── LetInitializerFor1.js │ │ │ │ ├── Error_ForInWithInitializerConst.js │ │ │ │ ├── LetInFor.js │ │ │ │ ├── LetNoInitializer.js │ │ │ │ ├── LetInitializerFor2.js │ │ │ │ ├── NestedLet.js │ │ │ │ ├── NestedFunction3.js │ │ │ │ ├── LetInitializerForIn.js │ │ │ │ ├── NestedFunction1.js │ │ │ │ ├── TopLevelLetVar.js │ │ │ │ ├── TopLevelLetConst.js │ │ │ │ ├── BlockBinding8.js │ │ │ │ ├── BlockBinding9.js │ │ │ │ ├── LetInForBreak.js │ │ │ │ ├── LetInForContinue.js │ │ │ │ ├── BlockBinding10.js │ │ │ │ ├── LetInitializerFor3.js │ │ │ │ ├── LetWithForIn.js │ │ │ │ ├── DeepNestedLet.js │ │ │ │ ├── LetWithFor.js │ │ │ │ ├── NestedFunction2.js │ │ │ │ ├── DeepNestedLetVarNoInit.js │ │ │ │ ├── DeepNestedLetVar.js │ │ │ │ ├── DeepNestedLetConst.js │ │ │ │ ├── LetInForBreakInner.js │ │ │ │ ├── Error_FunctionExpressionInBlock.js │ │ │ │ ├── LetInForContinueInner.js │ │ │ │ ├── Error_BlockBinding1.js │ │ │ │ ├── LetInForBreakNamed.js │ │ │ │ ├── LetInForContinueNamed.js │ │ │ │ ├── LetWithSwitch.js │ │ │ │ ├── BlockBinding7.js │ │ │ │ ├── LetWithSwitch2.js │ │ │ │ ├── DeconstructingBlockBinding.js │ │ │ │ ├── LetInClass.js │ │ │ │ ├── BlockBinding6.js │ │ │ │ ├── BlockBinding3.js │ │ │ │ ├── BlockBinding4.js │ │ │ │ ├── LetInProperties.js │ │ │ │ ├── LetForInitializers1.js │ │ │ │ ├── BlockBinding2.js │ │ │ │ ├── BlockBinding5.js │ │ │ │ └── LetInClosure.js │ │ │ ├── DefaultParameters │ │ │ │ ├── Strict.js │ │ │ │ └── Error_SetAccessor.js │ │ │ ├── ArrayComprehension │ │ │ │ ├── Error_NotDefined.js │ │ │ │ ├── Error_Disabled.js │ │ │ │ └── Closure.js │ │ │ ├── Annotations │ │ │ │ ├── resources │ │ │ │ │ ├── exported-default-function.js │ │ │ │ │ ├── exported-default-class.js │ │ │ │ │ ├── exported-functions.js │ │ │ │ │ ├── exported-classes.js │ │ │ │ │ └── setup.js │ │ │ │ ├── UnannotatedUntypedFunction.js │ │ │ │ ├── SimpleFunction.js │ │ │ │ ├── GeneratorFunction.js │ │ │ │ ├── Error_annotated_var.js │ │ │ │ ├── FunctionParameter.js │ │ │ │ ├── ConstructorParam.js │ │ │ │ ├── Constructor.js │ │ │ │ ├── MethodParam.js │ │ │ │ ├── AnnotatedTypedParam.js │ │ │ │ ├── FunctionMultipleParameters.js │ │ │ │ ├── AnnotatedFunctionTypedParam.js │ │ │ │ ├── MultipleAnnotatedFunction.js │ │ │ │ ├── ClassConstructor.js │ │ │ │ ├── SetterParam.js │ │ │ │ ├── StaticGetter.js │ │ │ │ ├── FunctionMultipleAnnotatedParameter.js │ │ │ │ ├── StaticMethod.js │ │ │ │ ├── ClassInsideObjectGetter.js │ │ │ │ ├── NestedFunction.js │ │ │ │ ├── PropertyMethodStringName.js │ │ │ │ ├── FunctionInsideClassGetter.js │ │ │ │ ├── MultipleParameterTypes.js │ │ │ │ ├── StaticSetter.js │ │ │ │ ├── ClassGeneratorMethod.js │ │ │ │ ├── GetAccessorStringName.js │ │ │ │ ├── ExportedFunction.js │ │ │ │ ├── ExportedClass.js │ │ │ │ ├── AnnotatedTypedClass.js │ │ │ │ └── UnannotatedTypedClass.js │ │ │ ├── GeneratorComprehension │ │ │ │ ├── Error_NotDefined.js │ │ │ │ ├── Error_Disabled.js │ │ │ │ └── Skip_Closure.js │ │ │ ├── FreeVariableChecker │ │ │ │ ├── Typeof.js │ │ │ │ ├── Error_With.js │ │ │ │ ├── WithBasic.js │ │ │ │ └── WithVarDecl.js │ │ │ ├── NumericLiteral │ │ │ │ ├── Error_Disabled.js │ │ │ │ ├── Error_NoOctalDigits.js │ │ │ │ └── Error_NoBinaryDigits.js │ │ │ ├── PropertyMethodAssignment │ │ │ │ ├── Error_NotNamed.js │ │ │ │ └── Error_Disabled.js │ │ │ ├── ComputedPropertyNames │ │ │ │ ├── Symbol.js │ │ │ │ └── Error_Disabled.js │ │ │ ├── Promise.js │ │ │ ├── TypeAssertions │ │ │ │ ├── resources │ │ │ │ │ └── exported-function.js │ │ │ │ ├── DefaultParam.js │ │ │ │ ├── ExportedFunction.js │ │ │ │ ├── Variables.js │ │ │ │ └── PrimitiveValueTypes.js │ │ │ ├── Types │ │ │ │ ├── TypeAnnotations.js │ │ │ │ └── TypeSyntax.js │ │ │ ├── Symbol │ │ │ │ ├── TransformationOff.js │ │ │ │ ├── GetOwnPropertySymbols.js │ │ │ │ ├── ObjectModel.js │ │ │ │ └── Inherited.js │ │ │ ├── AsyncFunctions │ │ │ │ ├── PromiseCast.js │ │ │ │ ├── AsyncSyntax.js │ │ │ │ ├── Yield.js │ │ │ │ ├── Complete.js │ │ │ │ ├── Error_Disabled.js │ │ │ │ ├── AsyncMethodObjectLiteral.js │ │ │ │ ├── AlphaRenaming.js │ │ │ │ ├── Finally.js │ │ │ │ ├── Timeout.js │ │ │ │ ├── Value.js │ │ │ │ ├── Throw.js │ │ │ │ └── AsyncMethod.js │ │ │ ├── Tools │ │ │ │ └── FreeVariableChecker.js │ │ │ ├── TempVarTransformer │ │ │ │ └── UseStrictDirective.js │ │ │ ├── ObjectMixin.js │ │ │ ├── ObjectAssign.js │ │ │ ├── PromiseThrowInResolve.js │ │ │ └── ArrayIterator.js │ │ ├── amd │ │ │ ├── deps │ │ │ │ ├── side-effect.js │ │ │ │ ├── side-effect2.js │ │ │ │ ├── foo.js │ │ │ │ └── bar.js │ │ │ ├── NamedExports.js │ │ │ ├── BasicImport.js │ │ │ ├── NestedImport.js │ │ │ ├── ImportNoImportClause.js │ │ │ ├── ImportEmptyImportClause.js │ │ │ ├── MultipleImports.js │ │ │ └── NamedImports.js │ │ ├── unit │ │ │ ├── node │ │ │ │ └── resources │ │ │ │ │ ├── x.js │ │ │ │ │ ├── only-export.js │ │ │ │ │ ├── reexport-x.js │ │ │ │ │ ├── compile-dir │ │ │ │ │ ├── dep.js │ │ │ │ │ └── file.js │ │ │ │ │ ├── import-export.js │ │ │ │ │ ├── iAmScript.js │ │ │ │ │ ├── iAmScriptAlso.es │ │ │ │ │ ├── import-x.js │ │ │ │ │ ├── import-another-x.js │ │ │ │ │ ├── export-default.js │ │ │ │ │ ├── export-default-class.js │ │ │ │ │ ├── class.js │ │ │ │ │ └── generator.js │ │ │ └── runtime │ │ │ │ ├── test_a.js │ │ │ │ ├── test_c.js │ │ │ │ ├── subdir │ │ │ │ ├── test_e.js │ │ │ │ └── test_d.js │ │ │ │ ├── throwsError.js │ │ │ │ ├── test_b.js │ │ │ │ ├── side-effect.js │ │ │ │ ├── throwsError.output │ │ │ │ ├── test_script.js │ │ │ │ ├── test_module.js │ │ │ │ └── test_source_map_module.js │ │ ├── commonjs │ │ │ ├── deps │ │ │ │ ├── side-effect.js │ │ │ │ ├── side-effect2.js │ │ │ │ ├── foo.js │ │ │ │ └── bar.js │ │ │ ├── BasicImport.js │ │ │ ├── NestedImport.js │ │ │ ├── ImportNoImportClause.js │ │ │ ├── ImportEmptyImportClause.js │ │ │ ├── MultipleImports.js │ │ │ └── NamedImports.js │ │ └── node-commonjs-test.js │ ├── traceur │ ├── traceur-build │ ├── third_party │ │ ├── codemirror-3.22 │ │ │ ├── .travis.yml │ │ │ ├── .gitignore │ │ │ ├── doc │ │ │ │ └── logo.png │ │ │ ├── .gitattributes │ │ │ ├── theme │ │ │ │ └── ambiance-mobile.css │ │ │ ├── addon │ │ │ │ ├── display │ │ │ │ │ └── fullscreen.css │ │ │ │ ├── lint │ │ │ │ │ └── yaml-lint.js │ │ │ │ ├── fold │ │ │ │ │ └── foldgutter.css │ │ │ │ └── edit │ │ │ │ │ └── trailingspace.js │ │ │ ├── test │ │ │ │ └── mode_test.css │ │ │ ├── mode │ │ │ │ ├── rpm │ │ │ │ │ └── spec │ │ │ │ │ │ └── spec.css │ │ │ │ ├── tiddlywiki │ │ │ │ │ └── tiddlywiki.css │ │ │ │ ├── ruby │ │ │ │ │ └── test.js │ │ │ │ └── tiki │ │ │ │ │ └── tiki.css │ │ │ ├── bower.json │ │ │ └── bin │ │ │ │ ├── authors.sh │ │ │ │ └── lint │ │ └── README │ ├── logo │ │ ├── tc.ai │ │ ├── tc.eps │ │ ├── tc.jpg │ │ └── tc.png │ ├── index.html │ ├── codereview.settings │ ├── build │ │ └── parse-tree-visitor.header │ └── demo │ │ ├── async-read-file.js │ │ └── expressServer.js │ └── audioContextPolyfill.js ├── chapter01 ├── modules │ ├── fifthModule.js │ ├── firstModule.js │ ├── secondModule.js │ ├── sixthModule.js │ ├── fourthModule.js │ ├── thirdModule.js │ ├── Animal.js │ └── index.html ├── images │ ├── cat.png │ ├── makeBig.png │ ├── makeSmall.png │ ├── ratio_16x9.png │ ├── ratio_4x3.png │ ├── screenShot.png │ ├── sourcePage.png │ └── spritesheet.png ├── iframes │ └── .sourcePage.html.swp ├── rooms.json ├── 03_forEach.html ├── 08_objectKeys.html ├── 05_forEachWithAnIndexCounter.html ├── 06_forEachWithArrowFunction.html └── 24_gettersAndSetters.html ├── chapter10 ├── .swp ├── images │ └── animals.png └── .followingPaths.html.swp ├── chapter08 ├── images │ ├── 0.png │ ├── 1.png │ ├── 2.png │ ├── 3.png │ ├── sky.png │ ├── finish.png │ ├── forest.png │ ├── green.png │ ├── pink.png │ ├── star.png │ ├── states.png │ ├── tile.png │ ├── violet.png │ ├── yellow.png │ ├── animals.png │ ├── flappyFairy.png │ ├── greenBlock.png │ └── walkcycle.png ├── .01_states.html.swo ├── .01_states.html.swp └── .07_flappyFairy.html.swp ├── chapter02 ├── images │ ├── cat.png │ └── tileset.png ├── fonts │ └── puzzler.otf └── .jshintrc ├── chapter03 ├── images │ ├── cat.png │ ├── tiger.png │ ├── animals.png │ └── hedgehog.png ├── fonts │ ├── PetMe64.ttf │ └── puzzler.otf └── json │ └── rooms.json ├── chapter04 ├── images │ ├── cat.png │ ├── up.png │ ├── button.png │ ├── down.png │ ├── fairy.png │ ├── over.png │ ├── tiger.png │ ├── animals.png │ └── hedgehog.png └── fonts │ ├── PetMe64.ttf │ └── puzzler.otf ├── chapter06 ├── images │ ├── cat.png │ ├── up.png │ ├── button.png │ ├── down.png │ ├── over.png │ ├── tiger.png │ ├── animals.png │ └── hedgehog.png └── fonts │ ├── PetMe64.ttf │ └── puzzler.otf ├── chapter07 ├── images │ ├── cat.png │ ├── sky.png │ ├── blob.png │ ├── cloud.png │ ├── door.png │ ├── grass.png │ ├── rock.png │ ├── star.png │ ├── dungeon.png │ ├── explorer.png │ ├── marbles.png │ ├── treasure.png │ ├── platforms.png │ └── treasureHunter.png ├── fonts │ ├── PetMe64.ttf │ └── puzzler.otf └── .05_rectangleCollision.html.swp ├── chapter09 └── sounds │ ├── bounce.mp3 │ ├── music.wav │ ├── shoot.wav │ ├── explosion.wav │ └── audioTileset.wav ├── chapter12 └── images │ ├── phobos.png │ └── spaceship.png ├── chapter11 ├── images │ └── animals.png ├── bloxyee │ ├── images │ │ ├── red.png │ │ ├── up.png │ │ ├── ball.png │ │ ├── blue.png │ │ ├── down.png │ │ ├── green.png │ │ ├── over.png │ │ ├── star.png │ │ ├── title.png │ │ ├── bloxyee.png │ │ ├── orange.png │ │ ├── paddle.png │ │ └── violet.png │ ├── sounds │ │ ├── music.wav │ │ └── bounce.wav │ ├── .bloxyee.html.swn │ ├── .bloxyee.html.swo │ ├── .bloxyee.html.swp │ └── fonts │ │ └── puzzler.otf └── .01_basicEngine.html.swp └── README.md /.gitmodules: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/wiki/.gitignore: -------------------------------------------------------------------------------- 1 | !out -------------------------------------------------------------------------------- /chapter01/modules/fifthModule.js: -------------------------------------------------------------------------------- 1 | export let mood = "Happy"; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Empty.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/null.js: -------------------------------------------------------------------------------- 1 | null -------------------------------------------------------------------------------- /chapter10/.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter10/.swp -------------------------------------------------------------------------------- /chapter01/modules/firstModule.js: -------------------------------------------------------------------------------- 1 | export let hello = "Hello from the firstModule!"; 2 | -------------------------------------------------------------------------------- /chapter01/modules/secondModule.js: -------------------------------------------------------------------------------- 1 | export let hello = "Hello from the secondModule!"; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/amd/deps/side-effect.js: -------------------------------------------------------------------------------- 1 | this.sideEffect = 1; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/amd/deps/side-effect2.js: -------------------------------------------------------------------------------- 1 | this.sideEffect = 1; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/node/resources/x.js: -------------------------------------------------------------------------------- 1 | export var x = 'x'; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/runtime/test_a.js: -------------------------------------------------------------------------------- 1 | export var name = 'A'; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/runtime/test_c.js: -------------------------------------------------------------------------------- 1 | export var name = 'C'; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/amd/NamedExports.js: -------------------------------------------------------------------------------- 1 | export var someExport = 'val'; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/commonjs/deps/side-effect.js: -------------------------------------------------------------------------------- 1 | this.sideEffect++; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/commonjs/deps/side-effect2.js: -------------------------------------------------------------------------------- 1 | this.sideEffect++; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/a.js: -------------------------------------------------------------------------------- 1 | export var a = 'A'; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/c.js: -------------------------------------------------------------------------------- 1 | export var c = 'C'; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/x.js: -------------------------------------------------------------------------------- 1 | export var x = 'X'; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/node/resources/only-export.js: -------------------------------------------------------------------------------- 1 | export var x = 6; -------------------------------------------------------------------------------- /chapter08/images/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/0.png -------------------------------------------------------------------------------- /chapter08/images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/1.png -------------------------------------------------------------------------------- /chapter08/images/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/2.png -------------------------------------------------------------------------------- /chapter08/images/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/3.png -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Classes/SemiColon.js: -------------------------------------------------------------------------------- 1 | class SemiColon { 2 | ; 3 | } -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/a2.js: -------------------------------------------------------------------------------- 1 | export var a = 'A2'; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/b.js: -------------------------------------------------------------------------------- 1 | module c from './c'; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/d.js: -------------------------------------------------------------------------------- 1 | export * from './a'; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/default.js: -------------------------------------------------------------------------------- 1 | export default 42; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/node/resources/reexport-x.js: -------------------------------------------------------------------------------- 1 | export {x} from "./x"; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/runtime/subdir/test_e.js: -------------------------------------------------------------------------------- 1 | export var name = 'E'; 2 | -------------------------------------------------------------------------------- /chapter01/images/cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter01/images/cat.png -------------------------------------------------------------------------------- /chapter02/images/cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter02/images/cat.png -------------------------------------------------------------------------------- /chapter03/images/cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter03/images/cat.png -------------------------------------------------------------------------------- /chapter04/images/cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter04/images/cat.png -------------------------------------------------------------------------------- /chapter04/images/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter04/images/up.png -------------------------------------------------------------------------------- /chapter06/images/cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter06/images/cat.png -------------------------------------------------------------------------------- /chapter06/images/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter06/images/up.png -------------------------------------------------------------------------------- /chapter07/images/cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/images/cat.png -------------------------------------------------------------------------------- /chapter07/images/sky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/images/sky.png -------------------------------------------------------------------------------- /chapter08/images/sky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/sky.png -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/f.js: -------------------------------------------------------------------------------- 1 | export var f = () => this; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/side-effect.js: -------------------------------------------------------------------------------- 1 | this.sideEffect++; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/node/resources/compile-dir/dep.js: -------------------------------------------------------------------------------- 1 | export var q = 'q'; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/runtime/throwsError.js: -------------------------------------------------------------------------------- 1 | throw new Error('test-intepreter'); -------------------------------------------------------------------------------- /chapter01/modules/sixthModule.js: -------------------------------------------------------------------------------- 1 | (() => { 2 | console.log("Hello from the sixthModule"); 3 | })(); 4 | -------------------------------------------------------------------------------- /chapter02/fonts/puzzler.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter02/fonts/puzzler.otf -------------------------------------------------------------------------------- /chapter03/fonts/PetMe64.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter03/fonts/PetMe64.ttf -------------------------------------------------------------------------------- /chapter03/fonts/puzzler.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter03/fonts/puzzler.otf -------------------------------------------------------------------------------- /chapter03/images/tiger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter03/images/tiger.png -------------------------------------------------------------------------------- /chapter04/fonts/PetMe64.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter04/fonts/PetMe64.ttf -------------------------------------------------------------------------------- /chapter04/fonts/puzzler.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter04/fonts/puzzler.otf -------------------------------------------------------------------------------- /chapter04/images/button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter04/images/button.png -------------------------------------------------------------------------------- /chapter04/images/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter04/images/down.png -------------------------------------------------------------------------------- /chapter04/images/fairy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter04/images/fairy.png -------------------------------------------------------------------------------- /chapter04/images/over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter04/images/over.png -------------------------------------------------------------------------------- /chapter04/images/tiger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter04/images/tiger.png -------------------------------------------------------------------------------- /chapter06/fonts/PetMe64.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter06/fonts/PetMe64.ttf -------------------------------------------------------------------------------- /chapter06/fonts/puzzler.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter06/fonts/puzzler.otf -------------------------------------------------------------------------------- /chapter06/images/button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter06/images/button.png -------------------------------------------------------------------------------- /chapter06/images/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter06/images/down.png -------------------------------------------------------------------------------- /chapter06/images/over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter06/images/over.png -------------------------------------------------------------------------------- /chapter06/images/tiger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter06/images/tiger.png -------------------------------------------------------------------------------- /chapter07/fonts/PetMe64.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/fonts/PetMe64.ttf -------------------------------------------------------------------------------- /chapter07/fonts/puzzler.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/fonts/puzzler.otf -------------------------------------------------------------------------------- /chapter07/images/blob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/images/blob.png -------------------------------------------------------------------------------- /chapter07/images/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/images/cloud.png -------------------------------------------------------------------------------- /chapter07/images/door.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/images/door.png -------------------------------------------------------------------------------- /chapter07/images/grass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/images/grass.png -------------------------------------------------------------------------------- /chapter07/images/rock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/images/rock.png -------------------------------------------------------------------------------- /chapter07/images/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/images/star.png -------------------------------------------------------------------------------- /chapter08/images/finish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/finish.png -------------------------------------------------------------------------------- /chapter08/images/forest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/forest.png -------------------------------------------------------------------------------- /chapter08/images/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/green.png -------------------------------------------------------------------------------- /chapter08/images/pink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/pink.png -------------------------------------------------------------------------------- /chapter08/images/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/star.png -------------------------------------------------------------------------------- /chapter08/images/states.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/states.png -------------------------------------------------------------------------------- /chapter08/images/tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/tile.png -------------------------------------------------------------------------------- /chapter08/images/violet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/violet.png -------------------------------------------------------------------------------- /chapter08/images/yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/yellow.png -------------------------------------------------------------------------------- /chapter09/sounds/bounce.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter09/sounds/bounce.mp3 -------------------------------------------------------------------------------- /chapter09/sounds/music.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter09/sounds/music.wav -------------------------------------------------------------------------------- /chapter09/sounds/shoot.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter09/sounds/shoot.wav -------------------------------------------------------------------------------- /chapter12/images/phobos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter12/images/phobos.png -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/traceur: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require('./src/node/command.js'); 4 | -------------------------------------------------------------------------------- /chapter01/images/makeBig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter01/images/makeBig.png -------------------------------------------------------------------------------- /chapter02/images/tileset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter02/images/tileset.png -------------------------------------------------------------------------------- /chapter03/images/animals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter03/images/animals.png -------------------------------------------------------------------------------- /chapter03/images/hedgehog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter03/images/hedgehog.png -------------------------------------------------------------------------------- /chapter04/images/animals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter04/images/animals.png -------------------------------------------------------------------------------- /chapter04/images/hedgehog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter04/images/hedgehog.png -------------------------------------------------------------------------------- /chapter06/images/animals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter06/images/animals.png -------------------------------------------------------------------------------- /chapter06/images/hedgehog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter06/images/hedgehog.png -------------------------------------------------------------------------------- /chapter07/images/dungeon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/images/dungeon.png -------------------------------------------------------------------------------- /chapter07/images/explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/images/explorer.png -------------------------------------------------------------------------------- /chapter07/images/marbles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/images/marbles.png -------------------------------------------------------------------------------- /chapter07/images/treasure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/images/treasure.png -------------------------------------------------------------------------------- /chapter08/.01_states.html.swo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/.01_states.html.swo -------------------------------------------------------------------------------- /chapter08/.01_states.html.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/.01_states.html.swp -------------------------------------------------------------------------------- /chapter08/images/animals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/animals.png -------------------------------------------------------------------------------- /chapter10/images/animals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter10/images/animals.png -------------------------------------------------------------------------------- /chapter11/images/animals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/images/animals.png -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/EmptyNamedImport.js: -------------------------------------------------------------------------------- 1 | import {} from './resources/m'; 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/m2.js: -------------------------------------------------------------------------------- 1 | var z = 'z'; 2 | export {z as var}; 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/side-effect2.js: -------------------------------------------------------------------------------- 1 | this.sideEffect++; 2 | 3 | 4 | -------------------------------------------------------------------------------- /chapter01/images/makeSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter01/images/makeSmall.png -------------------------------------------------------------------------------- /chapter01/images/ratio_16x9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter01/images/ratio_16x9.png -------------------------------------------------------------------------------- /chapter01/images/ratio_4x3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter01/images/ratio_4x3.png -------------------------------------------------------------------------------- /chapter01/images/screenShot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter01/images/screenShot.png -------------------------------------------------------------------------------- /chapter01/images/sourcePage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter01/images/sourcePage.png -------------------------------------------------------------------------------- /chapter01/images/spritesheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter01/images/spritesheet.png -------------------------------------------------------------------------------- /chapter01/modules/fourthModule.js: -------------------------------------------------------------------------------- 1 | export {x, y}; 2 | 3 | let x = 10, 4 | y = 20, 5 | z = 30; 6 | 7 | 8 | -------------------------------------------------------------------------------- /chapter07/images/platforms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/images/platforms.png -------------------------------------------------------------------------------- /chapter08/images/flappyFairy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/flappyFairy.png -------------------------------------------------------------------------------- /chapter08/images/greenBlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/greenBlock.png -------------------------------------------------------------------------------- /chapter08/images/walkcycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/images/walkcycle.png -------------------------------------------------------------------------------- /chapter09/sounds/explosion.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter09/sounds/explosion.wav -------------------------------------------------------------------------------- /chapter11/bloxyee/images/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/images/red.png -------------------------------------------------------------------------------- /chapter11/bloxyee/images/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/images/up.png -------------------------------------------------------------------------------- /chapter12/images/spaceship.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter12/images/spaceship.png -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/m.js: -------------------------------------------------------------------------------- 1 | export var a = 1; 2 | export var b = 2; 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/n.js: -------------------------------------------------------------------------------- 1 | export var c = 3; 2 | export var d = 4; 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/traceur-build: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require('./build/node/command.js'); 4 | -------------------------------------------------------------------------------- /chapter08/.07_flappyFairy.html.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter08/.07_flappyFairy.html.swp -------------------------------------------------------------------------------- /chapter09/sounds/audioTileset.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter09/sounds/audioTileset.wav -------------------------------------------------------------------------------- /chapter10/.followingPaths.html.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter10/.followingPaths.html.swp -------------------------------------------------------------------------------- /chapter11/.01_basicEngine.html.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/.01_basicEngine.html.swp -------------------------------------------------------------------------------- /chapter11/bloxyee/images/ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/images/ball.png -------------------------------------------------------------------------------- /chapter11/bloxyee/images/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/images/blue.png -------------------------------------------------------------------------------- /chapter11/bloxyee/images/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/images/down.png -------------------------------------------------------------------------------- /chapter11/bloxyee/images/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/images/green.png -------------------------------------------------------------------------------- /chapter11/bloxyee/images/over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/images/over.png -------------------------------------------------------------------------------- /chapter11/bloxyee/images/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/images/star.png -------------------------------------------------------------------------------- /chapter11/bloxyee/images/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/images/title.png -------------------------------------------------------------------------------- /chapter11/bloxyee/sounds/music.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/sounds/music.wav -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/default-name.js: -------------------------------------------------------------------------------- 1 | var p = 4; 2 | export {p as default}; 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/m3.js: -------------------------------------------------------------------------------- 1 | import {var as x} from './m2'; 2 | export {x}; 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/o.js: -------------------------------------------------------------------------------- 1 | export * from './m'; 2 | export * from './n'; 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/runtime/test_b.js: -------------------------------------------------------------------------------- 1 | module c from './test_c'; 2 | 3 | export var name = 'B'; 4 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/third_party/codemirror-3.22/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | -------------------------------------------------------------------------------- /chapter01/modules/thirdModule.js: -------------------------------------------------------------------------------- 1 | export {color, shape}; 2 | 3 | let color = "red", 4 | shape = "circle"; 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /chapter07/images/treasureHunter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/images/treasureHunter.png -------------------------------------------------------------------------------- /chapter11/bloxyee/.bloxyee.html.swn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/.bloxyee.html.swn -------------------------------------------------------------------------------- /chapter11/bloxyee/.bloxyee.html.swo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/.bloxyee.html.swo -------------------------------------------------------------------------------- /chapter11/bloxyee/.bloxyee.html.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/.bloxyee.html.swp -------------------------------------------------------------------------------- /chapter11/bloxyee/fonts/puzzler.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/fonts/puzzler.otf -------------------------------------------------------------------------------- /chapter11/bloxyee/images/bloxyee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/images/bloxyee.png -------------------------------------------------------------------------------- /chapter11/bloxyee/images/orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/images/orange.png -------------------------------------------------------------------------------- /chapter11/bloxyee/images/paddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/images/paddle.png -------------------------------------------------------------------------------- /chapter11/bloxyee/images/violet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/images/violet.png -------------------------------------------------------------------------------- /chapter11/bloxyee/sounds/bounce.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter11/bloxyee/sounds/bounce.wav -------------------------------------------------------------------------------- /chapter01/iframes/.sourcePage.html.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter01/iframes/.sourcePage.html.swp -------------------------------------------------------------------------------- /chapter07/.05_rectangleCollision.html.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/chapter07/.05_rectangleCollision.html.swp -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/ImportAsExportAs.js: -------------------------------------------------------------------------------- 1 | module m from './resources/m3'; 2 | assert.equal(m.x, 'z'); 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/i.js: -------------------------------------------------------------------------------- 1 | export var i = 0; 2 | export function inc() { 3 | i++; 4 | } 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/RegularExpression.js: -------------------------------------------------------------------------------- 1 | var re1 = /a*b/; 2 | var re2 = /=a+/; 3 | var re3 = /\//; 4 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TemplateLiterals/resources/f.js: -------------------------------------------------------------------------------- 1 | export function f(...args) { 2 | return args; 3 | } 4 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/node/resources/compile-dir/file.js: -------------------------------------------------------------------------------- 1 | import {q} from './dep'; 2 | export var p = 'module'; 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/node/resources/import-export.js: -------------------------------------------------------------------------------- 1 | import Q from './export-default-class'; 2 | export {Q}; 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/logo/tc.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/library/plugins/traceur-compiler/logo/tc.ai -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/logo/tc.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/library/plugins/traceur-compiler/logo/tc.eps -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/logo/tc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/library/plugins/traceur-compiler/logo/tc.jpg -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/logo/tc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/library/plugins/traceur-compiler/logo/tc.png -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/amd/BasicImport.js: -------------------------------------------------------------------------------- 1 | import {Foo} from './deps/foo'; 2 | 3 | assert.equal('Foo from foo.js', Foo); 4 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/amd/NestedImport.js: -------------------------------------------------------------------------------- 1 | import {Bar} from './deps/bar'; 2 | 3 | assert.equal('Bar from bar.js', Bar); 4 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/ModuleName.module.js: -------------------------------------------------------------------------------- 1 | assert.equal(__moduleName, 'feature/Modules/ModuleName.module'); 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/node/resources/iAmScript.js: -------------------------------------------------------------------------------- 1 | iAmScript = true; // The last statement becomes the value of the Script. -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/runtime/side-effect.js: -------------------------------------------------------------------------------- 1 | this.sideEffect = 6; 2 | export var currentSideEffect = () => this.sideEffect; -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/runtime/subdir/test_d.js: -------------------------------------------------------------------------------- 1 | module e from './test_e'; 2 | export {e}; 3 | export var name = 'D'; 4 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/runtime/throwsError.output: -------------------------------------------------------------------------------- 1 | ./traceur test/unit/runtime/throwsError.js 2>&1 | wc -l 2 | 11 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/commonjs/BasicImport.js: -------------------------------------------------------------------------------- 1 | import {Foo} from './deps/foo'; 2 | 3 | assert.equal('Foo from foo.js', Foo); 4 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/commonjs/NestedImport.js: -------------------------------------------------------------------------------- 1 | import {Bar} from './deps/bar'; 2 | 3 | assert.equal('Bar from bar.js', Bar); 4 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ObjectInitialiserShorthand/Error_Keyword.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | 3 | var object = {var}; 4 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TemplateLiterals/InModule.js: -------------------------------------------------------------------------------- 1 | module m from './resources/m'; 2 | module n from './resources/n'; 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/node/resources/iAmScriptAlso.es: -------------------------------------------------------------------------------- 1 | iAmScript = true; // The last statement becomes the value of the Script. -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Classes/Error_Disabled.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --classes=false 3 | 4 | class C {} 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/ModuleDefault.js: -------------------------------------------------------------------------------- 1 | module m from './resources/default'; 2 | 3 | assert.equal(m.default, 42); 4 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/export-conflict.js: -------------------------------------------------------------------------------- 1 | export var a = 'a'; 2 | export * from './a'; // also exports a 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TemplateLiterals/resources/m.js: -------------------------------------------------------------------------------- 1 | import {f} from './f'; 2 | 3 | assert.equal('a', (f `a`)[0][0]); 4 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TemplateLiterals/resources/n.js: -------------------------------------------------------------------------------- 1 | import {f} from './f'; 2 | 3 | assert.equal('b', (f `b`)[0][0]); 4 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/third_party/codemirror-3.22/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /npm-debug.log 3 | test.html 4 | .tern-* 5 | *~ 6 | *.swp 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/default-class.js: -------------------------------------------------------------------------------- 1 | export default class { 2 | m() { 3 | return 'm'; 4 | } 5 | }; 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Rest/Strict.js: -------------------------------------------------------------------------------- 1 | function f(...xs) { 2 | 'use strict'; 3 | return this; 4 | } 5 | 6 | assert.isUndefined(f()); -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Spread/Error_Disabled.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --spread=false 3 | 4 | [0, 1, ...[2, 3]]; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/ImplicitSemiColon.js: -------------------------------------------------------------------------------- 1 | function f() { 2 | return 3 | 42; 4 | } 5 | 6 | assert.isUndefined(f()); -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TemplateLiterals/Error_NotClosed.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | 3 | function f() {} 4 | 5 | f`not closed \` 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Yield/Error_MissingStar.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | 3 | function simpleGenerator() { 4 | yield 1; 5 | } 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/TestClass.js: -------------------------------------------------------------------------------- 1 | export class TestClass { 2 | static method() { 3 | return 42; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TemplateLiterals/Error_InvalidSubstitution.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | 3 | function f() {} 4 | 5 | f`a${ ` 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TemplateLiterals/Error_InvalidSubstitution2.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | 3 | function f() {} 4 | 5 | f`a${ }` 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/StaticMethod.js: -------------------------------------------------------------------------------- 1 | import {TestClass} from './resources/TestClass'; 2 | assert.equal(TestClass.method(), 42); 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/ThisInModules.js: -------------------------------------------------------------------------------- 1 | var global = this; 2 | 3 | module m from './resources/f'; 4 | assert.equal(global, m.f()); 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/amd/deps/foo.js: -------------------------------------------------------------------------------- 1 | export var Foo = 'Foo from foo.js'; 2 | export var Bar = 'Bar from foo.js'; 3 | export var Baz = 'Baz from foo.js'; 4 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrowFunctions/Error_FreeVariableChecker.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | var identity = (identityParam) -> missingIdentifier; 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/DefaultParams.js: -------------------------------------------------------------------------------- 1 | function f([x] = [1], {y} = {y: 2}) { 2 | return x + y; 3 | } 4 | 5 | assert.equal(3, f()); -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/Error_Disabled.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --destructuring=false 3 | 4 | var [x, y] = [0, 1]; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/Strict.js: -------------------------------------------------------------------------------- 1 | function f({x}) { 2 | 'use strict'; 3 | return this; 4 | } 5 | 6 | assert.isUndefined(f({x: 42})); -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/Error_Disabled.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --block-binding=false 3 | 4 | { 5 | let x = 42; 6 | } 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Error_RegExpNotClosed.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:2: Expected '/' in regular expression literal 3 | 4 | / -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/node/resources/import-x.js: -------------------------------------------------------------------------------- 1 | import {x} from './reexport-x'; 2 | this.result = x; // To verify execution, test this global value. -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/amd/deps/bar.js: -------------------------------------------------------------------------------- 1 | import {Foo} from './foo'; 2 | 3 | export var Bar = 'Bar from bar.js'; 4 | 5 | assert.equal('Foo from foo.js', Foo); 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/commonjs/deps/foo.js: -------------------------------------------------------------------------------- 1 | export var Foo = 'Foo from foo.js'; 2 | export var Bar = 'Bar from foo.js'; 3 | export var Baz = 'Baz from foo.js'; 4 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrowFunctions/Error_CoverInitialiser2.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:5: Unexpected token '=' 3 | 4 | ({a = 0}); 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrowFunctions/FreeVariableChecker.js: -------------------------------------------------------------------------------- 1 | var identity = (identityParam) => identityParam; 2 | assert.equal(1234, identity(1234)); 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/DefaultParameters/Strict.js: -------------------------------------------------------------------------------- 1 | function f(a = 1) { 2 | 'use strict'; 3 | return this; 4 | } 5 | 6 | assert.isUndefined(f()); 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/Error_ExportKeyword.module.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:9: 'identifier' expected 3 | 4 | export {if}; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/Error_ModuleNoNewline.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :5:3: Semi-colon expected 3 | 4 | module 5 | m from 'm'; 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Yield/DefaultArguments.js: -------------------------------------------------------------------------------- 1 | function* f(x = 1) { 2 | yield x; 3 | } 4 | 5 | for (var x of f(42)) { 6 | assert.equal(42, x); 7 | } -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/commonjs/deps/bar.js: -------------------------------------------------------------------------------- 1 | import {Foo} from './foo'; 2 | 3 | export var Bar = 'Bar from bar.js'; 4 | 5 | assert.equal('Foo from foo.js', Foo); 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrowFunctions/Error_Disabled.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --arrow-functions=false 3 | 4 | var identity = (x) -> x; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Classes/ExtendObject.js: -------------------------------------------------------------------------------- 1 | // Can no longer extend objects. 2 | assert.throw(function() { 3 | class C extends {} {} 4 | }, TypeError); 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/Error_ExportKeyword2.module.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:9: 'identifier' expected 3 | 4 | export {if as x}; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/Error_ForInWithInitializerLet.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --block-binding 3 | 4 | for (let i = 0 in {}) { 5 | } 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/UnicodeEscapeSequenceInName.js: -------------------------------------------------------------------------------- 1 | var a\u0062c = 1; 2 | assert.equal(1, abc); 3 | 4 | var λ = 2; 5 | assert.equal(2, \u03bb); 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Yield/EmptyGenerator.js: -------------------------------------------------------------------------------- 1 | function* f() { 2 | } 3 | 4 | var g = f(); 5 | assert.deepEqual(g.next(), {done: true, value: undefined}); 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrayComprehension/Error_NotDefined.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | 3 | var array = [for (notDefined of [0]) notDefined]; 4 | notDefined; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrowFunctions/Arguments.js: -------------------------------------------------------------------------------- 1 | function f() { 2 | var args = (() => arguments)(); 3 | assert.equal(args, arguments); 4 | } 5 | 6 | f(); 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrowFunctions/Error_SpreadOutsideFormals.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:13: Unexpected token ... 3 | 4 | var f = (x, ...xs); 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/Error_InvalidCoverInitialisedName.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:5: Unexpected token '=' 3 | 4 | ({x = 42}); 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Error_Arguments.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :7:6: Unexpected token ) 3 | 4 | function f(x) { 5 | } 6 | 7 | f(x, ); 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Error_FunctionParam.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: 'identifier' expected 3 | 4 | function f(x,) { 5 | return x; 6 | } 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TemplateLiterals/Strict.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function f(...args) { 4 | return this; 5 | } 6 | 7 | assert.equal(undefined, f `a`); 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Yield/This.js: -------------------------------------------------------------------------------- 1 | function* f() { 2 | yield this; 3 | } 4 | 5 | var o = {}; 6 | for (var x of f.call(o)) { 7 | assert.equal(o, x); 8 | } 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/node/resources/import-another-x.js: -------------------------------------------------------------------------------- 1 | export var iAmNotScript = true; 2 | this.result = 17; // To verify execution, test this global value. 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/commonjs/ImportNoImportClause.js: -------------------------------------------------------------------------------- 1 | this.sideEffect = 1; 2 | import './deps/side-effect'; 3 | assert.equal(2, this.sideEffect); 4 | this.sideEffect = 1; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/resources/exported-default-function.js: -------------------------------------------------------------------------------- 1 | import {Anno} from './setup'; 2 | 3 | @Anno 4 | export default function (@Anno x) { 5 | } 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrowFunctions/Error_Precedence.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:26: Semi-colon expected 3 | 4 | var identity = (x) => {x}.bind({}); 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/Error_InvalidArrowRest.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:11: Unexpected token ... 3 | 4 | var f = ([...xs, ys]) => xs; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/GeneratorComprehension/Error_NotDefined.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | 3 | var iter = (for (notDefined of [0]) notDefined); 4 | notDefined; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/Error_ConstMissingInitializer.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --block-binding 3 | 4 | const x = 1, y; // Missing initialiser! 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrowFunctions/Error_InvalidFormalParameters.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:15: Unexpected token + 3 | 4 | var f = (a, b + 5) => a + b; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/FreeVariableChecker/Typeof.js: -------------------------------------------------------------------------------- 1 | function f() { 2 | if (typeof x1) 3 | x1; 4 | } 5 | 6 | function g() { 7 | typeof x2; 8 | x2; 9 | } 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/Error_InvalidExport.module.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:9: 'c' is not exported by ' 3 | 4 | export {c} from './resources/a'; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/Error_InvalidModuleDeclaration2.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: 4:33: Unexpected token . 3 | 4 | module b from './resources/a.js'.c; -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/ImportNoImportClause.js: -------------------------------------------------------------------------------- 1 | this.sideEffect = 1; 2 | import './resources/side-effect'; 3 | assert.equal(2, this.sideEffect); 4 | this.sideEffect = 1; -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetNoInitializerGlobal.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | let x2; 4 | assert.equal(undefined, x2); 5 | x2 = 2; 6 | assert.equal(2, x2); 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/node/resources/export-default.js: -------------------------------------------------------------------------------- 1 | export class q { 2 | foo() { 3 | console.log('class method'); 4 | } 5 | } 6 | export default q; 7 | var p = 5; 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/commonjs/ImportEmptyImportClause.js: -------------------------------------------------------------------------------- 1 | this.sideEffect = 1; 2 | import {} from './deps/side-effect2'; 3 | assert.equal(2, this.sideEffect); 4 | this.sideEffect = 1; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrowFunctions/CoverInitialiser.js: -------------------------------------------------------------------------------- 1 | // https://github.com/google/traceur-compiler/issues/478 2 | 3 | function f() { 4 | (1 ? ({a=0}) => {} : 1); 5 | } 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/Error_InvalidExport2.module.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:9: 'c' is not exported by ' 3 | 4 | export {c as d} from './resources/a'; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/NumericLiteral/Error_Disabled.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --numeric-literals=false 3 | // Error: :5:2: Semi-colon expected 4 | 5 | 0b11; 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Error_WithInModule.module.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: 4:1: Strict mode code may not include a with statement 3 | 4 | with ({}) {} 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TemplateLiterals/InBlock.js: -------------------------------------------------------------------------------- 1 | // This just tests that we do not get any compile errors. 2 | 3 | { 4 | `abc` 5 | } 6 | 7 | (function() { 8 | `def` 9 | }); -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Yield/Error_Disabled2.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --forOf=false 3 | 4 | var s = []; 5 | for (var i of yieldFor()) { 6 | s.push(i); 7 | } 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/third_party/codemirror-3.22/doc/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kittykatattack/agd/HEAD/library/plugins/traceur-compiler/third_party/codemirror-3.22/doc/logo.png -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/FunctionObjectPattern.js: -------------------------------------------------------------------------------- 1 | function f({a, b: {c}}, d) { 2 | return [a, c, d]; 3 | } 4 | 5 | assertArrayEquals([1, 2, 3], f({a: 1, b: {c: 2}}, 3)); -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ObjectInitialiserShorthand/Error_Disabled.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --property-name-shorthand=false 3 | 4 | var x = 42; 5 | var object = {x}; 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TemplateLiterals/Error_Disabled.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --template-literals=false 3 | // Error: :5:1: Unexpected token ` 4 | 5 | `abc`; 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/runtime/test_script.js: -------------------------------------------------------------------------------- 1 | import {name as a} from './test_a'; 2 | import {name as b} from './test_b'; 3 | import {name as c} from './test_c'; 4 | 5 | [a, b, c]; 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/wiki/CompilingOffline/greeter.js: -------------------------------------------------------------------------------- 1 | // greeter.js 2 | class Greeter { 3 | sayHi() { console.log('Hi!'); } 4 | } 5 | 6 | var greeter = new Greeter(); 7 | greeter.sayHi(); -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrowFunctions/Error_Precedence3.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :5:9: Semi-colon expected 3 | // Error: :5:9: Unexpected token => 4 | 5 | (x) + y => y; 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/ExportStar.js: -------------------------------------------------------------------------------- 1 | module o from './resources/o'; 2 | 3 | assert.equal(1, o.a); 4 | assert.equal(2, o.b); 5 | assert.equal(3, o.c); 6 | assert.equal(4, o.d); 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/ImportEmptyImportClause.js: -------------------------------------------------------------------------------- 1 | this.sideEffect = 1; 2 | import {} from './resources/side-effect2'; 3 | assert.equal(2, this.sideEffect); 4 | this.sideEffect = 1; -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/PropertyMethodAssignment/Error_NotNamed.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | 3 | var object = { 4 | "notNamedField"() { 5 | return notNamedField; 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/Error_ForWithoutInitializerConst.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --block-binding 3 | 4 | var i = 0; 5 | for (const x; i < 3; i++) { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/third_party/codemirror-3.22/.gitattributes: -------------------------------------------------------------------------------- 1 | *.txt text 2 | *.js text 3 | *.html text 4 | *.md text 5 | *.json text 6 | *.yml text 7 | *.css text 8 | *.svg text 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/third_party/codemirror-3.22/theme/ambiance-mobile.css: -------------------------------------------------------------------------------- 1 | .cm-s-ambiance.CodeMirror { 2 | -webkit-box-shadow: none; 3 | -moz-box-shadow: none; 4 | box-shadow: none; 5 | } 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/resources/exported-default-class.js: -------------------------------------------------------------------------------- 1 | import {Anno} from './setup'; 2 | 3 | @Anno 4 | export default class { 5 | @Anno 6 | annotatedMethod() {} 7 | } 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrowFunctions/Error_CoverInitialiser.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :5:16: Unexpected token '=' 3 | 4 | function f() { 5 | ({a = (0, {a = 0})} = {}) 6 | } 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrowFunctions/Error_Precedence2.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :5:11: Semi-colon expected 3 | // Error: :5:11: Unexpected token => 4 | 5 | (x) + (y) => y; 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/Error_ImportStar.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:8: 'string literal' expected 3 | 4 | import * from './resources/m'; 5 | assert.equal(3, a + b); 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/resources/clockwise.js: -------------------------------------------------------------------------------- 1 | import {counterclockwise} from '../ImportCircular.module'; 2 | export function clockwise() { 3 | return 'The circle is complete'; 4 | } 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Error_NoLineTerminatorPostfix.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: 7:7: Unexpected token ; 3 | 4 | function f(x) { 5 | var x = 0; 6 | x 7 | ++; 8 | } 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Error_YieldStarNewLine.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :6:7: Unexpected token * 3 | 4 | function* yieldStarNewLine() { 5 | yield 6 | *42; 7 | } 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Classes/StaticSymbol.js: -------------------------------------------------------------------------------- 1 | // Options: --symbols 2 | var sym = Symbol(); 3 | class C { 4 | static [sym]() { 5 | return 42; 6 | } 7 | } 8 | assert.equal(C[sym](), 42); 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ComputedPropertyNames/Symbol.js: -------------------------------------------------------------------------------- 1 | // Options: --symbols 2 | 3 | var s = Symbol(); 4 | 5 | var object = { 6 | [s]: 42 7 | }; 8 | 9 | assert.equal(object[s], 42); 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/runtime/test_module.js: -------------------------------------------------------------------------------- 1 | export {name as a} from './test_a'; 2 | export {name as b} from './test_b'; 3 | export {name as c} from './test_c'; 4 | 5 | export var name = 'test'; 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/amd/ImportNoImportClause.js: -------------------------------------------------------------------------------- 1 | // AMD executes the dependencies before executing the module. 2 | import './deps/side-effect'; 3 | assert.equal(1, this.sideEffect); 4 | this.sideEffect = 0; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/Error_ForInWithInitializer.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: initialiser is not allowed in for-in loop with pattern 3 | 4 | for (var {k} = {} in {}) { 5 | } 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Promise.js: -------------------------------------------------------------------------------- 1 | // Async. 2 | 3 | var p = new Promise((resolve, reject) => { 4 | resolve(42); 5 | }); 6 | p.then((v) => { 7 | assert.equal(v, 42); 8 | done(); 9 | }); 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Advanced Game Design with HTML5 and JavaScript 2 | ============================================== 3 | Source code repository for [Advanced Game Design with HTML5 and 4 | JavaScript] (http://www.apress.com/9781430258001) 5 | -------------------------------------------------------------------------------- /chapter01/modules/Animal.js: -------------------------------------------------------------------------------- 1 | export default class { 2 | constructor() { 3 | this.legs = 4; 4 | this.eyes = 2; 5 | this.say = "Huh?"; 6 | } 7 | speak() { 8 | console.log(this.say); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrowFunctions/Error_SpreadNotLast.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :6:17: ')' expected 3 | // Error: :6:12: Unexpected token ... 4 | 5 | { 6 | let f = (...xs, x) => xs; 7 | } -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/Error_Catch.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: innerX is not defined 3 | 4 | try { 5 | throw [0]; 6 | } catch ([innerX]) { 7 | 8 | } 9 | 10 | innerX; 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/NumericLiteral/Error_NoOctalDigits.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --numeric-literals 3 | // Error: :5:3: Octal Integer Literal must contain at least one digit 4 | 5 | 0o; 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/PropertyMethodAssignment/Error_Disabled.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --property-methods=false 3 | 4 | var object = { 5 | method() { 6 | return 42; 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Error_UnicodeEscapeSequenceInName.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:5: Character code '48' is not a valid identifier start char 3 | 4 | var \u0030ab = 42; // 0ab 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Error_WithInStrictProgram.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: 6:1: Strict mode code may not include a with statement 3 | 4 | 'use foo'; 5 | 'use strict'; 6 | with ({}) {} 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TypeAssertions/resources/exported-function.js: -------------------------------------------------------------------------------- 1 | import {assert} from './assert' 2 | export function exportedParamAndReturn(a:Number):Number { 3 | return a === 0 ? 'invalid' : a; 4 | } 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Yield/Arguments.js: -------------------------------------------------------------------------------- 1 | function* f() { 2 | yield [arguments[0], arguments[1]]; 3 | } 4 | 5 | for (var arr of f(1, 2)) { 6 | assert.equal(1, arr[0]); 7 | assert.equal(2, arr[1]); 8 | } -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/runtime/test_source_map_module.js: -------------------------------------------------------------------------------- 1 | export {name as a} from './test_a'; 2 | export {name as b} from './test_b'; 3 | export {name as c} from './test_c'; 4 | 5 | export var name = 'test'; 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/third_party/README: -------------------------------------------------------------------------------- 1 | http://closure-library.googlecode.com/svn/trunk/ closure-library 2 | https://github.com/johnjbarton/source-map source-map fork from https://github.com/mozilla/source-map BSD 3 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/third_party/codemirror-3.22/addon/display/fullscreen.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-fullscreen { 2 | position: fixed; 3 | top: 0; left: 0; right: 0; bottom: 0; 4 | height: auto; 5 | z-index: 9; 6 | } 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/amd/ImportEmptyImportClause.js: -------------------------------------------------------------------------------- 1 | // AMD executes the dependencies before executing the module. 2 | import {} from './deps/side-effect2'; 3 | assert.equal(1, this.sideEffect); 4 | this.sideEffect = 0; -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/amd/MultipleImports.js: -------------------------------------------------------------------------------- 1 | import {Foo, Bar, Baz} from './deps/foo'; 2 | 3 | assert.equal('Foo from foo.js', Foo); 4 | assert.equal('Bar from foo.js', Bar); 5 | assert.equal('Baz from foo.js', Baz); 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ComputedPropertyNames/Error_Disabled.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --computed-property-names=false 3 | // Error: :6:3: '}' expected 4 | 5 | var object = { 6 | [1]: 2 7 | }; 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/NumericLiteral/Error_NoBinaryDigits.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --numeric-literals 3 | // Error: :5:3: Binary Integer Literal must contain at least one digit 4 | 5 | 0b; 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/ForInWithInitializerVar.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | var x = 0; 4 | 5 | // ES5 allows this. 6 | for (var i = (x = 1) in {}) { 7 | } 8 | 9 | assert.equal(1, x); 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Error_WithInClass.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: 6:5: Strict mode code may not include a with statement 3 | 4 | class C { 5 | method() { 6 | with ({}) {} 7 | } 8 | } -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/amd/NamedImports.js: -------------------------------------------------------------------------------- 1 | import {Foo as f, Bar as b, Baz} from './deps/foo'; 2 | 3 | assert.equal('Foo from foo.js', f); 4 | assert.equal('Bar from foo.js', b); 5 | assert.equal('Baz from foo.js', Baz); 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/commonjs/MultipleImports.js: -------------------------------------------------------------------------------- 1 | import {Foo, Bar, Baz} from './deps/foo'; 2 | 3 | assert.equal('Foo from foo.js', Foo); 4 | assert.equal('Bar from foo.js', Bar); 5 | assert.equal('Baz from foo.js', Baz); 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/UnannotatedUntypedFunction.js: -------------------------------------------------------------------------------- 1 | function UnannotatedUntypedParams(x, y) {} 2 | 3 | assert(!UnannotatedUntypedParams.annotations); 4 | assert(!UnannotatedUntypedParams.parameters); 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ArrayComprehension/Error_Disabled.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --array-comprehension=false 3 | // Error: :5:14: ']' expected 4 | 5 | var array = [for (x of [0, 1, 2, 3, 4]) x]; 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/Error_ForOfWithInitializerLet.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --block-binding 3 | 4 | function* gen() { 5 | yield 1; 6 | } 7 | 8 | for (let i = 0 of gen()) { 9 | } 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/Error_ForOfWithInitializerVar.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --block-binding 3 | 4 | function* gen() { 5 | yield 1; 6 | } 7 | 8 | for (var i = 0 of gen()) { 9 | } 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/NameBindingInFunction.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | { 4 | function f() { 5 | return f; 6 | } 7 | var g = f; 8 | f = 42; 9 | assert.equal(42, g()); 10 | } 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/TopLevelLet.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | let x = 'let'; 4 | 5 | // ---------------------------------------------------------------------------- 6 | 7 | assert.equal(x, 'let'); -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Yield/Error_Disabled.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --generators=false 3 | 4 | function* range(start, end) { 5 | for (var i = start; i < end; i++) { 6 | yield i; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/commonjs/NamedImports.js: -------------------------------------------------------------------------------- 1 | import {Foo as f, Bar as b, Baz} from './deps/foo'; 2 | 3 | assert.equal('Foo from foo.js', f); 4 | assert.equal('Bar from foo.js', b); 5 | assert.equal('Baz from foo.js', Baz); 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/FreeVariableChecker/Error_With.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: missingVarWith is not defined 3 | var o = {}; 4 | with (o) { 5 | missingVarWith = 42; 6 | } 7 | var x = missingVarWith * 2; 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ObjectInitialiserShorthand/Error_MissingVar.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: missingVarObjectInitialiserShorthand is not defined 3 | 4 | var object = {missingVarObjectInitialiserShorthand}; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/Error_ForOfWithInitializerConst.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --block-binding 3 | 4 | function* gen() { 5 | yield 1; 6 | } 7 | 8 | for (const i = 0 of gen()) { 9 | } 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/NumberLiteralMemberExpression.js: -------------------------------------------------------------------------------- 1 | assert.equal(1 .toString(), '1'); 2 | assert.equal(1.1.toString(), '1.1'); 3 | assert.equal(1e1.toString(), '10'); 4 | assert.equal(1E1.toString(), '10'); 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/UseStrictEscapeSequence.js: -------------------------------------------------------------------------------- 1 | function testUseStrictEscapeSequence() { 2 | 'use str\x69ct'; 3 | return this; 4 | } 5 | 6 | assert.notEqual(testUseStrictEscapeSequence(), undefined); 7 | 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/node/resources/export-default-class.js: -------------------------------------------------------------------------------- 1 | export default class Q { 2 | foo() { 3 | console.log('class method'); 4 | } 5 | get name() { 6 | return 'Q'; 7 | } 8 | }; 9 | var p = 5; 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/SimpleFunction.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations 2 | import {Anno} from './resources/setup'; 3 | 4 | @Anno 5 | function Simple() {} 6 | 7 | assertArrayEquals([new Anno], Simple.annotations); 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/DefaultParameters/Error_SetAccessor.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :6:15: ')' expected 3 | 4 | var object = { 5 | // Default parameters are not allowed on setters. 6 | set x(value = 42) {} 7 | } -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Rest/Error_SetAccessor.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :5:9: 'identifier' expected 3 | 4 | var object = { 5 | set x(...rest) { 6 | // rest is not allowed for set accessor 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetInitializerFor1.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | for (let x = 1; x < 10; x++) { 4 | x; 5 | } 6 | 7 | // ---------------------------------------------------------------------------- 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/UseStrictLineContinuation.js: -------------------------------------------------------------------------------- 1 | function testUseStrictLineContinuation() { 2 | 'use \ 3 | strict'; 4 | return this; 5 | } 6 | 7 | assert.notEqual(testUseStrictLineContinuation(), undefined); 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/GeneratorFunction.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations 2 | import {Anno} from './resources/setup'; 3 | 4 | @Anno 5 | function* generate() {} 6 | 7 | assertArrayEquals([new Anno], generate.annotations); 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/resources/exported-functions.js: -------------------------------------------------------------------------------- 1 | import {Anno} from './setup'; 2 | 3 | @Anno 4 | export function exportedAnnotated(@Anno x) { 5 | } 6 | 7 | export function exportedUnannotated(@Anno x) { 8 | } 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/GeneratorComprehension/Error_Disabled.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --generator-comprehension=false 3 | // Error: :5:13: Unexpected token for 4 | 5 | var iter = (for (x of [0, 1, 2, 3, 4]) x); 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/Error_ForInWithInitializerConst.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --block-binding 3 | // Error: let/const in for-in statement may not have initialiser 4 | 5 | for (const i = 0 in {}) { 6 | } 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetInFor.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | for (var x = 0; x < 10; x ++) { 4 | let y = 'let y'; 5 | } 6 | 7 | // ---------------------------------------------------------------------------- 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetNoInitializer.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | var x = 1; 4 | { 5 | let x; 6 | assert.equal(undefined, x); 7 | x = 2; 8 | assert.equal(2, x); 9 | } 10 | assert.equal(1, x); 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Spread/CallWithUndefined.js: -------------------------------------------------------------------------------- 1 | function f(...args) { 2 | return args; 3 | } 4 | 5 | assert.throw(function() { 6 | // Should throw due to ToObject(undefined) 7 | f(0, ...undefined, 1); 8 | }, TypeError) 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Error_StrictKeywordsInStrict.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :5:26: implements is a reserved identifier 3 | 4 | 'use strict'; 5 | function testImplements({implements}) { 6 | return 42; 7 | } 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Classes/DeriveFromObject.js: -------------------------------------------------------------------------------- 1 | class DerivedFromObject extends Object { 2 | } 3 | 4 | // ---------------------------------------------------------------------------- 5 | 6 | // TODO(rnystrom): No tests for this? 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Error_StrictKeywordsInArguments.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:25: implements is a reserved identifier 3 | 4 | function testImplements(implements) { 5 | 'use strict'; 6 | return 42; 7 | } 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Classes/Error_Super.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :8:17: Unexpected token ; 3 | 4 | class A {} 5 | 6 | class ImproperSuper extends A { 7 | method() { 8 | return super; 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/Error_ImportDefault.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: feature/Modules/Error_ImportDefault.js:4:8: 'default' is not exported by 'feature/Modules/resources/a' 3 | 4 | import error from './resources/a'; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/Error_annotated_var.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --annotations 3 | // Error: :9:1: Unsupported annotated expression 4 | import {Anno} from './resources/setup'; 5 | 6 | @Anno 7 | var test = 1; 8 | 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Error_StrictKeywordsInArgumentsPattern.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:26: implements is a reserved identifier 3 | 4 | function testImplements({implements}) { 5 | 'use strict'; 6 | return 42; 7 | } 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/wiki/CompilingOffline/UsingCompiledFiles.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | You should see "Hi!" in your console. 7 | 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/FunctionParameter.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations 2 | import {Anno} from './resources/setup'; 3 | 4 | function AnnotatedParam(@Anno('x') x) {} 5 | 6 | assertArrayEquals([[new Anno('x')]], AnnotatedParam.parameters); 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/Error_InvalidExport3.module.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: feature/Modules/Error_InvalidExport3.module.js:4:9: 'c' is not exported by 'feature/Modules/resources/b' 3 | 4 | export {c as d} from './resources/b'; 5 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetInitializerFor2.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | for (let x = 1, y = 2, z = 3; x < 10; x ++) { 4 | y++; 5 | z++; 6 | } 7 | 8 | // ---------------------------------------------------------------------------- 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Error_WithInStrictFunction.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: 7:3: Strict mode code may not include a with statement 3 | 4 | function testWithInStrict() { 5 | 'use foo'; 6 | 'use strict'; 7 | with ({}) {} 8 | } -------------------------------------------------------------------------------- /chapter02/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "undef": true, 3 | "unused": true, 4 | "globals": {"KA": false}, 5 | "indent": 2, 6 | "eqeqeq": true, 7 | "strict": true, 8 | "trailing": true, 9 | "maxlen": 70, 10 | "browser": true, 11 | "devel": true 12 | } 13 | 14 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/Error_ForOfWithInitializer.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: initialiser is not allowed in for-of loop with pattern 3 | // Error: for-of statement may not have initialiser 4 | 5 | for (var {k} = {} of []) { 6 | } 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Rest/Error_NotLast.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :4:46: ')' expected 3 | 4 | function invalidParam(noDefault, ...restParam, noRestAgain) { 5 | // Should fail to parse since non rest param is not allowed after 6 | // param. 7 | } -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Spread/Call.js: -------------------------------------------------------------------------------- 1 | function f(...args) { 2 | return args; 3 | } 4 | var result = f(0, ...[1, 2], 3); 5 | 6 | // ---------------------------------------------------------------------------- 7 | 8 | assertArrayEquals([0, 1, 2, 3], result); 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Types/TypeAnnotations.js: -------------------------------------------------------------------------------- 1 | // Options: --types=true --annotations=true 2 | 3 | class Test {} 4 | 5 | function abc(x: Test) : Test { 6 | var a : Test = new Test(); 7 | } 8 | 9 | function xyz(x: number, y: boolean): string {} 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Yield/GeneratorWithoutYieldOrReturn.js: -------------------------------------------------------------------------------- 1 | var x = 0; 2 | 3 | function* f() { 4 | x++; 5 | } 6 | 7 | var g = f(); 8 | assert.equal(x, 0); 9 | assert.deepEqual(g.next(), {done: true, value: undefined}); 10 | assert.equal(x, 1); 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/ConstructorParam.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations 2 | import {Anno} from './resources/setup'; 3 | 4 | class CtorParam { 5 | constructor(@Anno x) {} 6 | } 7 | 8 | assertArrayEquals([[new Anno]], CtorParam.parameters); 9 | 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/ObjectInitialiserShorthand/Ok.js: -------------------------------------------------------------------------------- 1 | var x = 42; 2 | var y = 43; 3 | var object = {x, y}; 4 | 5 | // ---------------------------------------------------------------------------- 6 | 7 | assert.equal(42, object.x); 8 | assert.equal(43, object.y); 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/NestedLet.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | var x = 'var'; 4 | { 5 | let y = 'let 1'; 6 | } 7 | { 8 | let y = 'let 2'; 9 | } 10 | 11 | // ---------------------------------------------------------------------------- 12 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/Constructor.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations 2 | import {Anno} from './resources/setup'; 3 | 4 | class AnnotatedCtor { 5 | @Anno2 6 | constructor() {} 7 | } 8 | 9 | assertArrayEquals([new Anno2], AnnotatedCtor.annotations); 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/NestedFunction3.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | function nestedFunction3() { 4 | let let_x = 'let x'; 5 | function function_foo() { } 6 | } 7 | 8 | // ---------------------------------------------------------------------------- 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Symbol/TransformationOff.js: -------------------------------------------------------------------------------- 1 | // Options: --symbols=false 2 | 3 | var s = Symbol(); 4 | var s2 = Symbol(); 5 | var object = {}; 6 | object[s] = 1; 7 | object[s2] = 2; 8 | 9 | assert.equal(object[s], 1); 10 | assert.equal(object[s2], 2); 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetInitializerForIn.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | let sum = 0; 4 | let a = [1,2,3]; 5 | for (let x in a) { 6 | sum = sum + a[x]; 7 | } 8 | 9 | // ---------------------------------------------------------------------------- 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/ArrayWithHoles.js: -------------------------------------------------------------------------------- 1 | var arr = [,1, ,3,]; 2 | assert.equal(4, arr.length); 3 | 4 | var arr2 = [,1, ,...[3],]; 5 | assert.equal(4, arr.length); 6 | 7 | var x, y; 8 | [x, , y] = [0, 1, 2]; 9 | assert.equal(0, x); 10 | assert.equal(2, y); 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/MethodParam.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations 2 | import {Anno} from './resources/setup'; 3 | 4 | class MethodParam { 5 | method(@Anno x) {} 6 | } 7 | 8 | assertArrayEquals([[new Anno]], MethodParam.prototype.method.parameters); 9 | 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Classes/Error_SuperAsTemplateTag.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :8:18: Unexpected token no substitution template 3 | 4 | class A {} 5 | 6 | class ImproperSuper extends A { 7 | method() { 8 | return super ``; 9 | } 10 | } 11 | 12 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/NestedFunction1.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | function nestedFunction1() { 4 | return function() { 5 | let let_x = 'let x'; 6 | } 7 | } 8 | 9 | // ---------------------------------------------------------------------------- 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/TopLevelLetVar.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | let x = 'let'; 4 | var y = 'var'; 5 | 6 | // ---------------------------------------------------------------------------- 7 | 8 | assert.equal('let', x); 9 | assert.equal('var', y); 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/codereview.settings: -------------------------------------------------------------------------------- 1 | # This file is used by gcl to get repository specific information. 2 | CODE_REVIEW_SERVER: https://codereview.appspot.com 3 | VIEW_VC: http://code.google.com/p/traceur-compiler/source/detail?r= 4 | CC_LIST: traceur-compiler-reviews@googlegroups.com 5 | 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/AsyncFunctions/PromiseCast.js: -------------------------------------------------------------------------------- 1 | // Options: --async-functions 2 | // Async. 3 | 4 | async function f() { 5 | var x = await 1; 6 | assert.equal(x, 1); 7 | x = await undefined; 8 | assert.equal(x, undefined); 9 | done(); 10 | } 11 | 12 | f(); 13 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/ImportDefault.js: -------------------------------------------------------------------------------- 1 | import x from './resources/default'; 2 | assert.equal(x, 42); 3 | 4 | import C from './resources/default-class'; 5 | assert.equal(new C().m(), 'm'); 6 | 7 | import {default as D} from './resources/default-name'; 8 | assert.equal(D, 4); 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/ModuleNoNewline.js: -------------------------------------------------------------------------------- 1 | module 2 | 'm' 3 | { 4 | var x = 42; 5 | } 6 | 7 | var module = {test: 42}; 8 | 9 | module; 10 | module.test; 11 | // No semicolon on next line 12 | module 13 | 14 | // No semicolon nor newline at end of next line 15 | module -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/TopLevelLetConst.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | let x = 'let'; 4 | const y = 'const'; 5 | 6 | // ---------------------------------------------------------------------------- 7 | 8 | assert.equal('let', x); 9 | assert.equal('const', y); 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Spread/NewBuiltin.js: -------------------------------------------------------------------------------- 1 | var d = new Date(...[2011, 4, 3]); 2 | 3 | // ---------------------------------------------------------------------------- 4 | 5 | assert.equal(2011, d.getFullYear()); 6 | assert.equal(4, d.getMonth()); 7 | assert.equal(3, d.getDate()); 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/third_party/codemirror-3.22/test/mode_test.css: -------------------------------------------------------------------------------- 1 | .mt-output .mt-token { 2 | border: 1px solid #ddd; 3 | white-space: pre; 4 | font-family: "Consolas", monospace; 5 | text-align: center; 6 | } 7 | 8 | .mt-output .mt-style { 9 | font-size: x-small; 10 | } 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/BlockBinding8.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | function f() { 4 | return 'outer'; 5 | } 6 | 7 | { 8 | function f() { 9 | return 'inner'; 10 | } 11 | 12 | assert.equal('inner', f()); 13 | } 14 | 15 | assert.equal('outer', f()); 16 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/BlockBinding9.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | function f() { 4 | return 'outer'; 5 | } 6 | 7 | { 8 | (function f() { 9 | return 'inner'; 10 | }); 11 | 12 | assert.equal('outer', f()); 13 | } 14 | 15 | assert.equal('outer', f()); 16 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetInForBreak.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | for (var x = 0; x < 10; x ++) { 4 | let y = 'let y'; 5 | if (x % 2 == 0) { 6 | break; 7 | } 8 | } 9 | 10 | // ---------------------------------------------------------------------------- 11 | -------------------------------------------------------------------------------- /library/plugins/audioContextPolyfill.js: -------------------------------------------------------------------------------- 1 | //WebAudio API AudioContext polyfill 2 | 3 | (function() { 4 | 5 | var vendors = ["ms", "webkit", "o"]; 6 | 7 | for(var x = 0; x < vendors.length && !window.AudioContext; ++x) 8 | { 9 | window.AudioContext = window[vendors[x]+"AudioContext"]; 10 | } 11 | 12 | }()); -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/AnnotatedTypedParam.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations --types 2 | import { 3 | Anno, 4 | X 5 | } from './resources/setup'; 6 | 7 | function AnnotatedTypedParam(@Anno x:X) {} 8 | 9 | assertArrayEquals([[X, new Anno]], AnnotatedTypedParam.parameters); 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Classes/PrototypeDescriptor.js: -------------------------------------------------------------------------------- 1 | class C {} 2 | 3 | var descr = Object.getOwnPropertyDescriptor(C, 'prototype'); 4 | assert.isFalse(descr.enumerable); 5 | assert.isFalse(descr.configurable); 6 | assert.isFalse(descr.writable); 7 | assert.equal(descr.value, C.prototype); 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/Method.js: -------------------------------------------------------------------------------- 1 | var object = { 2 | method({message: [head, ...tail], name}) { 3 | assert.equal('a', head); 4 | assertArrayEquals(['b', 'c'], tail); 5 | assert.equal('Error', name); 6 | } 7 | }; 8 | 9 | object.method(new Error('abc')); 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/SetAccessor.js: -------------------------------------------------------------------------------- 1 | var object = { 2 | set x({message: [head, ...tail], name}) { 3 | assert.equal('a', head); 4 | assertArrayEquals(['b', 'c'], tail); 5 | assert.equal('Error', name); 6 | } 7 | }; 8 | 9 | object.x = new Error('abc'); 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetInForContinue.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | for (var x = 0; x < 10; x ++) { 4 | let y = 'let y'; 5 | if (x % 2 == 0) { 6 | continue; 7 | } 8 | } 9 | 10 | // ---------------------------------------------------------------------------- 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/Error_StrictKeywordsInPropertyDefinitionIdentifierReference.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :6:11: yield is a reserved identifier 3 | 4 | function testStrictKeywordsInPropertyDefinitionIdentifierReference() { 5 | 'use strict'; 6 | return {yield}; 7 | } 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/FunctionMultipleParameters.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations 2 | import {Anno} from './resources/setup'; 3 | 4 | function MultipleParams(@Anno('x') x, @Anno('y') y) {} 5 | 6 | assertArrayEquals([[new Anno('x')], [new Anno('y')]], 7 | MultipleParams.parameters); 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/BlockBinding10.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | function f() { 4 | return 'outer'; 5 | } 6 | 7 | { 8 | var f = function f() { 9 | return 'inner'; 10 | }; 11 | 12 | assert.equal('inner', f()); 13 | } 14 | 15 | assert.equal('inner', f()); 16 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetInitializerFor3.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | for (let x = 1, y = x + 1; x < 10 && y != 0; x ++, y *= 2) { 4 | if (y > 300) { 5 | continue; 6 | } 7 | } 8 | 9 | // ---------------------------------------------------------------------------- 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetWithForIn.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | for (var x in [1,2,3]) { 4 | let let_y = x; 5 | for (var for_in_z in [4,5,6]) { 6 | continue; 7 | } 8 | } 9 | 10 | // ---------------------------------------------------------------------------- 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Symbol/GetOwnPropertySymbols.js: -------------------------------------------------------------------------------- 1 | // Options: --symbols 2 | 3 | var s1 = Symbol(); 4 | var s2 = Symbol(); 5 | var object = {a: 'a'}; 6 | object[s1] = 's1'; 7 | object.b = 'b'; 8 | object[s2] = 's2'; 9 | assertArrayEquals([s1, s2], Object.getOwnPropertySymbols(object)); 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/resources/exported-classes.js: -------------------------------------------------------------------------------- 1 | import {Anno} from './setup'; 2 | 3 | @Anno 4 | export class ExportedAnnotatedClass { 5 | @Anno 6 | annotatedMethod() {} 7 | } 8 | 9 | export class ExportedUnannotatedClass { 10 | @Anno 11 | annotatedMethod() {} 12 | } 13 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/Arguments.js: -------------------------------------------------------------------------------- 1 | function destructureArguments(x, y) { 2 | [arguments[0], [arguments[1]]] = [1, [2]] 3 | return x + y; 4 | } 5 | 6 | // ---------------------------------------------------------------------------- 7 | 8 | assert.equal(3, destructureArguments(1, 2)); 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/Error_ExportStarConflict.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: feature/Modules/resources/export-conflict.js:2:8: Duplicate export. 'a' was previously exported at feature/Modules/resources/export-conflict.js:1:12 3 | 4 | import {a} from './resources/export-conflict'; 5 | 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/DeepNestedLet.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | var a = 'var a'; 4 | { 5 | var b = 'var b'; 6 | { 7 | var c = 'var c'; 8 | let d = 'let d'; 9 | } 10 | } 11 | 12 | // ---------------------------------------------------------------------------- 13 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/node/resources/class.js: -------------------------------------------------------------------------------- 1 | class B { 2 | constructor(x) { 3 | this.x = x; 4 | } 5 | method() { 6 | return 1; 7 | } 8 | } 9 | 10 | class C extends B { 11 | method() { 12 | return super() + this.x; 13 | } 14 | } 15 | 16 | var result = new C(1).method(); 17 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/unit/node/resources/generator.js: -------------------------------------------------------------------------------- 1 | function* f(x, y) { 2 | yield x; 3 | yield y; 4 | } 5 | 6 | var result = []; 7 | 8 | for (var value of f(1, 2)) { 9 | result.push(value); 10 | } 11 | 12 | for (var value of (for (x of f(3, 4)) x * x)) { 13 | result.push(value); 14 | } 15 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/AnnotatedFunctionTypedParam.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations --types 2 | import { 3 | Anno, 4 | X 5 | } from './resources/setup'; 6 | 7 | @Anno 8 | function AnnotatedFnMultiParam(x:X, y) {} 9 | 10 | assertArrayEquals([[X], []], AnnotatedFnMultiParam.parameters); 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/MultipleAnnotatedFunction.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations 2 | import { 3 | Anno, 4 | Anno2 5 | } from './resources/setup'; 6 | 7 | @Anno 8 | @Anno2('val') 9 | function Multi() {} 10 | 11 | assertArrayEquals([new Anno, new Anno2('val')], Multi.annotations); 12 | 13 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Tools/FreeVariableChecker.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --freeVariableChecker 3 | try { 4 | var y = xxx; 5 | } catch (e) {} 6 | // test/unit/semantics/freeVariableChecker.traceur.js checks operation 7 | // of the checker, here we check that the option works in the compiler. 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetWithFor.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | for (var x = 0; x < 10; x++) { 4 | let let_y = 'let y'; 5 | for (var for_z = 0; for_z < 2; for_z ++) { 6 | break; 7 | } 8 | } 9 | 10 | // ---------------------------------------------------------------------------- 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/NestedFunction2.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | function nestedFunction2() { 4 | let let_func = function() { 5 | let let_x = 'let x'; 6 | } 7 | return let_func; 8 | } 9 | 10 | // ---------------------------------------------------------------------------- 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/DeepNestedLetVarNoInit.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | var var_a; 4 | { 5 | var var_b; 6 | { 7 | let let_c = 'let c'; 8 | { 9 | var var_d; 10 | } 11 | } 12 | } 13 | 14 | // ---------------------------------------------------------------------------- 15 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Yield/CommaOperator.js: -------------------------------------------------------------------------------- 1 | function* f(x, y) { 2 | yield x, yield y; 3 | return x + y; 4 | } 5 | 6 | var g = f(1, 2); 7 | assert.deepEqual(g.next(), {value: 1, done: false}); 8 | assert.deepEqual(g.next(1), {value: 2, done: false}); 9 | assert.deepEqual(g.next(2), {value: 3, done: true}); 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/DeepNestedLetVar.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | var a = 'var a'; 4 | { 5 | var b = 'var b'; 6 | { 7 | let c = 'let c'; 8 | { 9 | var d = 'var d'; 10 | } 11 | } 12 | } 13 | 14 | // ---------------------------------------------------------------------------- 15 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Yield/BinaryOperator.js: -------------------------------------------------------------------------------- 1 | function* f(x) { 2 | var a = (yield x) + (yield x + 1); 3 | return a; 4 | } 5 | 6 | var g = f(1); 7 | assert.deepEqual(g.next(), {value: 1, done: false}); 8 | assert.deepEqual(g.next(1), {value: 2, done: false}); 9 | assert.deepEqual(g.next(2), {value: 3, done: true}); 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/ClassConstructor.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations 2 | import { 3 | Anno, 4 | Anno2 5 | } from './resources/setup'; 6 | 7 | @Anno 8 | class AnnotatedClassCtor { 9 | @Anno2 10 | constructor() {} 11 | } 12 | 13 | assertArrayEquals([new Anno, new Anno2], AnnotatedClassCtor.annotations); 14 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/SetterParam.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations 2 | import {Anno} from './resources/setup'; 3 | 4 | class SetterParam { 5 | set prop(@Anno x) {} 6 | } 7 | 8 | assertArrayEquals([[new Anno]], 9 | Object.getOwnPropertyDescriptor(SetterParam.prototype, 'prop'). 10 | set.parameters); 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/DeepNestedLetConst.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | var a = 'var a'; 4 | { 5 | var b = 'var b'; 6 | { 7 | let c = 'let c'; 8 | { 9 | const d = 'const d'; 10 | } 11 | } 12 | } 13 | 14 | // ---------------------------------------------------------------------------- 15 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Classes/ExtendNonConstructableFunction.js: -------------------------------------------------------------------------------- 1 | 2 | assert.throw(function() { 3 | class C extends Math.pow {} 4 | }, TypeError); 5 | 6 | assert.throw(function() { 7 | function f() {} 8 | // prototype needs to be an Object or null. 9 | f.prototype = 42; 10 | class C extends f {} 11 | }, TypeError); 12 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Classes/SuperWithoutExtends.js: -------------------------------------------------------------------------------- 1 | class C { 2 | constructor() { 3 | this.x = true; 4 | } 5 | static m() { 6 | return super.hasOwnProperty('m'); 7 | } 8 | 9 | m() { 10 | return super.hasOwnProperty('x'); 11 | } 12 | } 13 | 14 | assert.isTrue(new C().m()); 15 | assert.isTrue(C.m()); 16 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/EvaluatesToRvalue.js: -------------------------------------------------------------------------------- 1 | function destructEvaluatesToRvalue() { 2 | var a; 3 | return [a] = [1, 2, 3]; 4 | } 5 | 6 | // ---------------------------------------------------------------------------- 7 | 8 | var result = destructEvaluatesToRvalue(); 9 | assertArrayEquals([1, 2, 3], result); 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/EvaluationOrder.js: -------------------------------------------------------------------------------- 1 | function destructEvaluationOrder() { 2 | var a; 3 | [a, a, a] = [1, 2, 3, 4]; 4 | return a; 5 | } 6 | 7 | // ---------------------------------------------------------------------------- 8 | 9 | var result = destructEvaluationOrder(); 10 | assert.equal(3, result); 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/ImportCircular.module.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: Unsupported circular dependency between feature/Modules/ImportCircular.module and feature/Modules/resources/clockwise 3 | 4 | import {clockwise} from './resources/clockwise'; 5 | export function counterclockwise() { 6 | return clockwise(); 7 | } 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TypeAssertions/DefaultParam.js: -------------------------------------------------------------------------------- 1 | // Options: --types=true --type-assertions --type-assertion-module=./resources/assert 2 | function initialized(a:Number = 1) { return a; } 3 | 4 | assert.equal(1, initialized()); 5 | assert.equal(2, initialized(2)); 6 | assert.throw(() => { initialized(''); }, chai.AssertionError); 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/StaticGetter.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations 2 | import {Anno} from './resources/setup'; 3 | 4 | class StaticGetter { 5 | @Anno 6 | static get prop() { return 'getter'; } 7 | } 8 | 9 | assertArrayEquals([new Anno], 10 | Object.getOwnPropertyDescriptor(StaticGetter, 'prop').get.annotations); 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/resources/setup.js: -------------------------------------------------------------------------------- 1 | export function X() {} 2 | X.toJSON = function () { return 'function X'; } 3 | 4 | export function Anno(value) { 5 | this.annotation = true; 6 | this.value = value; 7 | } 8 | 9 | export function Anno2(value) { 10 | this.annotation2 = true; 11 | this.value = value; 12 | } 13 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/AsyncFunctions/AsyncSyntax.js: -------------------------------------------------------------------------------- 1 | // Options: --async-functions 2 | 3 | var async; 4 | async 5 | function f() { 6 | return async + async; 7 | } 8 | 9 | async = 1; 10 | assert.equal(async, 1); 11 | assert.equal(f(), 2); 12 | 13 | async = async 14 | function g() { 15 | 16 | } 17 | 18 | assert.equal(async, 1); 19 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/third_party/codemirror-3.22/mode/rpm/spec/spec.css: -------------------------------------------------------------------------------- 1 | .cm-s-default span.cm-preamble {color: #b26818; font-weight: bold;} 2 | .cm-s-default span.cm-macro {color: #b218b2;} 3 | .cm-s-default span.cm-section {color: green; font-weight: bold;} 4 | .cm-s-default span.cm-script {color: red;} 5 | .cm-s-default span.cm-issue {color: yellow;} 6 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/FunctionMultipleAnnotatedParameter.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations 2 | import { 3 | Anno, 4 | Anno2 5 | } from './resources/setup'; 6 | 7 | function MultipleAnnotations(@Anno('x') @Anno2('x') x) {} 8 | 9 | assertArrayEquals([[new Anno('x'), new Anno2('x')]], 10 | MultipleAnnotations.parameters); 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/TopLevel.js: -------------------------------------------------------------------------------- 1 | var a, b, c, d; 2 | [a, [b, c], d] = ['hello', [',', 'junk'], ['world']]; 3 | 4 | // ---------------------------------------------------------------------------- 5 | 6 | assert.equal('hello', a); 7 | assert.equal(',', b); 8 | assert.equal('junk', c); 9 | assertArrayEquals(['world'], d); 10 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetInForBreakInner.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | for (var x = 0; x < 10; x ++) { 4 | for (var y = 0; y < 10; y ++) { 5 | let z = 'let z'; 6 | if (x == 7) { 7 | break; 8 | } 9 | } 10 | } 11 | 12 | // ---------------------------------------------------------------------------- 13 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Syntax/StringEscapes.js: -------------------------------------------------------------------------------- 1 | var o1 = { 2 | '\\\'': 42, 3 | '\0\b\f\n\r\t\v\x42\u1234': 1234 4 | }; 5 | var o2 = { 6 | '\\\'\ 7 | ': 42, 8 | '\0\b\f\n\r\t\v\x42\u1234': 1234 9 | }; 10 | 11 | assertArrayEquals(Object.keys(o1), Object.keys(o2)); 12 | assert.equal(42, o1['\\\'']); 13 | assert.equal(42, o2['\\\'']); 14 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Annotations/StaticMethod.js: -------------------------------------------------------------------------------- 1 | // Options: --annotations 2 | import {Anno} from './resources/setup'; 3 | 4 | class StaticMethod { 5 | @Anno 6 | static method(@Anno x) {} 7 | } 8 | 9 | assertArrayEquals([new Anno], StaticMethod.method.annotations); 10 | assertArrayEquals([[new Anno]], StaticMethod.method.parameters); 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/FreeVariableChecker/WithBasic.js: -------------------------------------------------------------------------------- 1 | var o = { 2 | unicorns: 42, 3 | fairyGodmothers: 3 4 | }; 5 | 6 | with (o) { 7 | x = 42; 8 | y = x * x; 9 | 10 | bubbles = 1000; 11 | fairyGodmotherBubbles = bubbles * fairyGodmothers; 12 | unicorns = bubbles * fairyGodmothers - (fairyGodmotherBubbles - unicorns); 13 | } 14 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/Error_FunctionExpressionInBlock.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --block-binding 3 | // Error: functionExpression is not defined 4 | 5 | { 6 | (function functionExpression() { 7 | return 'inner'; 8 | }); 9 | 10 | functionExpression; // function expression doesn't add name to the scope. 11 | } 12 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetInForContinueInner.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | for (var x = 0; x < 10; x ++) { 4 | for (var y = 0; y < 10; y ++) { 5 | let z = 'let z'; 6 | if (x == 7) { 7 | continue; 8 | } 9 | } 10 | } 11 | 12 | // ---------------------------------------------------------------------------- 13 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/third_party/codemirror-3.22/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CodeMirror", 3 | "main": ["lib/codemirror.js", "lib/codemirror.css"], 4 | "ignore": [ 5 | "**/.*", 6 | "node_modules", 7 | "components", 8 | "bin", 9 | "demo", 10 | "doc", 11 | "test", 12 | "index.html", 13 | "package.json" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/third_party/codemirror-3.22/mode/tiddlywiki/tiddlywiki.css: -------------------------------------------------------------------------------- 1 | span.cm-underlined { 2 | text-decoration: underline; 3 | } 4 | span.cm-strikethrough { 5 | text-decoration: line-through; 6 | } 7 | span.cm-brace { 8 | color: #170; 9 | font-weight: bold; 10 | } 11 | span.cm-table { 12 | color: blue; 13 | font-weight: bold; 14 | } 15 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Classes/NewClassExpression.js: -------------------------------------------------------------------------------- 1 | 2 | assert.equal((new class { 3 | get x() { 4 | return 'x'; 5 | } 6 | getX() { 7 | return this.x; 8 | } 9 | }).getX(), 'x'); 10 | 11 | assert.equal(new class { 12 | get y() { 13 | return 'y'; 14 | } 15 | getY() { 16 | return this.y; 17 | } 18 | }().getY(), 'y'); 19 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TemplateLiterals/CommaExpression.js: -------------------------------------------------------------------------------- 1 | assert.equal('24', `${ 1, 2 }${ 3, 4 }`); 2 | assert.equal('6', `${ 5, 6 }`); 3 | 4 | function templateLiteralCommaTest(callsite, x, y) { 5 | assert.equal(2, x); 6 | assert.equal(4, y); 7 | return x + y; 8 | } 9 | 10 | assert.equal(6, templateLiteralCommaTest`${ 1, 2 }${ 3, 4 }`); 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TemplateLiterals/StringRaw.js: -------------------------------------------------------------------------------- 1 | assert.equal('', String.raw ``); 2 | assert.equal('\n', String.raw ` 3 | `); 4 | assert.equal('\\n', String.raw `\n`); 5 | assert.equal('\\n42\\t', String.raw `\n${ 40 + 2 }\t`); 6 | assert.equal('\n42\t', String.raw ` 7 | ${42} `); 8 | assert.equal('\\\n42\\\n', String.raw `\ 9 | ${42}\ 10 | `); 11 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/Error_BlockBinding1.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Options: --block-binding 3 | // Error: inner is not defined 4 | 5 | function testBlock() { 6 | { 7 | let inner = 'inner value'; 8 | } 9 | 10 | var x = inner; 11 | } 12 | 13 | // ---------------------------------------------------------------------------- 14 | 15 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetInForBreakNamed.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | outer: 4 | for (var x = 0; x < 10; x ++) { 5 | for (var y = 0; y < 10; y ++) { 6 | let z = 'let z'; 7 | if (x == 7) { 8 | break outer; 9 | } 10 | } 11 | } 12 | 13 | // ---------------------------------------------------------------------------- 14 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/third_party/codemirror-3.22/bin/authors.sh: -------------------------------------------------------------------------------- 1 | # Combine existing list of authors with everyone known in git, sort, add header. 2 | tail --lines=+3 AUTHORS > AUTHORS.tmp 3 | git log --format='%aN' >> AUTHORS.tmp 4 | echo -e "List of CodeMirror contributors. Updated before every release.\n" > AUTHORS 5 | sort -u AUTHORS.tmp >> AUTHORS 6 | rm -f AUTHORS.tmp 7 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetInForContinueNamed.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | outer: 4 | for (var x = 0; x < 10; x ++) { 5 | for (var y = 0; y < 10; y ++) { 6 | let z = 'let z'; 7 | if (x == 7) { 8 | continue outer; 9 | } 10 | } 11 | } 12 | 13 | // ---------------------------------------------------------------------------- 14 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Symbol/ObjectModel.js: -------------------------------------------------------------------------------- 1 | // Options: --symbols 2 | 3 | var s = Symbol('s'); 4 | assert.equal(typeof s, 'symbol'); 5 | assert.equal(s.constructor, Symbol); 6 | assert.isFalse(s instanceof Symbol); 7 | 8 | assert.throws(() => { 9 | new Symbol; 10 | }); 11 | 12 | assert.equal(s.toString(), 'Symbol(s)'); 13 | assert.equal(s.valueOf(), s); 14 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Destructuring/FunctionArrayPattern.js: -------------------------------------------------------------------------------- 1 | function f([a, b, ...c], d) { 2 | return [a, b, c, d]; 3 | } 4 | assertArrayEquals([1, 2, [3, 4], 5], f([1, 2, 3, 4], 5)); 5 | 6 | function g([, a]) { 7 | return a; 8 | } 9 | assert.equal(g([0, 1]), 1); 10 | 11 | function h([, [, a]]) { 12 | return a; 13 | } 14 | assert.equal(h([0, [1, 2]]), 2); 15 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/AsyncFunctions/Yield.js: -------------------------------------------------------------------------------- 1 | // Options: --async-functions 2 | // Async. 3 | 4 | function asyncYield() { 5 | return asyncTimeout(0); 6 | } 7 | 8 | function asyncTimeout(ms) { 9 | return new Promise((resolve) => { 10 | setTimeout(resolve, ms); 11 | }); 12 | } 13 | 14 | (async function() { 15 | await asyncYield(); 16 | done(); 17 | })(); 18 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetWithSwitch.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | for (var i = 0; i < 5; i ++) { 4 | let let_x = 'let x'; 5 | 6 | switch (i) { 7 | case 0: 8 | break; 9 | case 2: 10 | break; 11 | default: 12 | break; 13 | } 14 | } 15 | 16 | // ---------------------------------------------------------------------------- 17 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Classes/InheritanceNameBinding.js: -------------------------------------------------------------------------------- 1 | class NameBindingBase {} 2 | 3 | class NameBindingDerived extends NameBindingBase { 4 | getX() { return this.x; } 5 | } 6 | 7 | // ---------------------------------------------------------------------------- 8 | 9 | var derived = new NameBindingDerived(); 10 | derived.x = 12; 11 | assert.equal(12, derived.getX()); 12 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/Error_ExportStarDuplicateExport.module.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: feature/Modules/Error_ExportStarDuplicateExport.module.js:5:8: Duplicate export. 'a' was previously exported at feature/Modules/Error_ExportStarDuplicateExport.module.js:4:8 3 | 4 | export * from './resources/a'; 5 | export * from './resources/a2'; 6 | 7 | assert.equal(1, 2); 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/Error_MissingExport.js: -------------------------------------------------------------------------------- 1 | // Should not compile. 2 | // Error: :6:12: 'y' is not exported by 'feature/Modules/resources/x' 3 | // Error: :6:15: 'z' is not exported by 'feature/Modules/resources/x' 4 | // Error: :7:9: 'w' is not exported by 'feature/Modules/resources/x' 5 | 6 | import {x, y, z} from './resources/x'; 7 | import {w} from './resources/x'; 8 | 9 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Modules/Exports.js: -------------------------------------------------------------------------------- 1 | module a from './resources/i'; 2 | 3 | (function() { 4 | 'use strict'; 5 | assert.equal(0, a.i); 6 | a.inc(); 7 | assert.equal(1, a.i); 8 | 9 | assert.throws(function() { 10 | a.i = 2; 11 | }, TypeError); 12 | })(); 13 | 14 | assert.equal(1, a.i); 15 | 16 | module d from './resources/d'; 17 | assert.equal('A', d.a); 18 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/BlockBinding7.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | function blockTest() { 4 | { 5 | let x = 'let x value'; 6 | function g() { 7 | return x; 8 | } 9 | return g; 10 | } 11 | } 12 | 13 | // ---------------------------------------------------------------------------- 14 | 15 | assert.equal('let x value', blockTest()()); 16 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/LetWithSwitch2.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | for (var i = 0; i < 5; i ++) { 4 | let let_x = 'let x'; 5 | 6 | switch (i) { 7 | case 0: 8 | continue; 9 | case 2: 10 | break; 11 | default: 12 | break; 13 | } 14 | } 15 | 16 | // ---------------------------------------------------------------------------- 17 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/TypeAssertions/ExportedFunction.js: -------------------------------------------------------------------------------- 1 | // Options: --types=true --type-assertions 2 | import {exportedParamAndReturn} from './resources/exported-function'; 3 | 4 | assert.equal(1, exportedParamAndReturn(1)); 5 | 6 | assert.throw(() => { exportedParamAndReturn(''); }, chai.AssertionError); 7 | assert.throw(() => { exportedParamAndReturn(0); }, chai.AssertionError); 8 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Yield/LabelledBlockGenerator.js: -------------------------------------------------------------------------------- 1 | var i = 0; 2 | var s = ''; 3 | 4 | function* f() { 5 | s += 'a'; 6 | while(i++ < 3) { 7 | s += 'b'; 8 | label1: { 9 | s += 'c'; 10 | break label1; 11 | s += 'd'; 12 | } 13 | s += 'e'; 14 | } 15 | s += 'f'; 16 | } 17 | 18 | var g = f(); 19 | g.next(); 20 | assert.equal(s, 'abcebcebcef'); 21 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Yield/ReturnYieldFor.js: -------------------------------------------------------------------------------- 1 | function* f() { 2 | return yield* h(); 3 | } 4 | 5 | function* h() { 6 | yield 111; 7 | yield 222; 8 | return 333; 9 | } 10 | 11 | var g = f(); 12 | 13 | assert.deepEqual({value: 111, done: false}, g.next()); 14 | assert.deepEqual({value: 222, done: false}, g.next()); 15 | assert.deepEqual({value: 333, done: true}, g.next()); 16 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Scope/DeconstructingBlockBinding.js: -------------------------------------------------------------------------------- 1 | // Options: --block-binding 2 | 3 | if (true) { 4 | let [a,b] = [1,2]; 5 | const [c,d] = [4,5]; 6 | } 7 | if (true) { 8 | let {x: [{e}, f], g} = {x: [{e:4}, 5], g: 6}; 9 | const a = 0, [b, {c, x: [d]}] = [1, {c: 2, x: [3]}]; 10 | } 11 | 12 | // ---------------------------------------------------------------------------- 13 | -------------------------------------------------------------------------------- /library/plugins/traceur-compiler/test/feature/Classes/Inheritance.js: -------------------------------------------------------------------------------- 1 | class SimpleBase {} 2 | class SimpleDerived extends SimpleBase {} 3 | 4 | // ---------------------------------------------------------------------------- 5 | 6 | var derived = new SimpleDerived(); 7 | assert.isTrue(derived instanceof SimpleDerived); 8 | assert.isTrue(derived instanceof SimpleBase); 9 | assert.isTrue(derived instanceof Object); 10 | -------------------------------------------------------------------------------- /chapter01/modules/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |