-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed discovery of identifiers in callback functions, fixes #10
updated tokentree lib
- Loading branch information
Showing
9 changed files
with
127 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# @install: lix --silent download "haxelib:/tokentree#1.2.14" into tokentree/1.2.14/haxelib | ||
-cp ${HAXE_LIBCACHE}/tokentree/1.2.14/haxelib/src | ||
-D tokentree=1.2.14 | ||
# @install: lix --silent download "haxelib:/tokentree#1.2.17" into tokentree/1.2.17/haxelib | ||
-cp ${HAXE_LIBCACHE}/tokentree/1.2.17/haxelib/src | ||
-D tokentree=1.2.17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package testcases.classes; | ||
|
||
import js.Browser; | ||
import tink.core.Future; | ||
import tink.core.Promise; | ||
|
||
@:expose class PrinterMain { | ||
public static function main():Void { | ||
// Setup stuff | ||
final futureTrigger = Future.trigger(); | ||
futureTrigger.trigger("Future"); | ||
|
||
final promise:Promise<String> = Promise.resolve("Promise"); | ||
|
||
// Example 1 - "Normal" usage of `Printer` (WORKS) | ||
new Printer("Normal"); | ||
|
||
// Example 2 - `Printer` used within promise handling (WORKS) | ||
promise.handle(result -> { | ||
switch (result) { | ||
case Success(text): new Printer(text); | ||
default: | ||
} | ||
}); | ||
|
||
// Example 3 - `Printer` used within future handling (FAILS) | ||
futureTrigger.asFuture().handle(text -> { | ||
new Printer(text); | ||
}); | ||
|
||
// Example 4 - `Printer` used within promise handling but promise is created in `TextLoader` (FAILS) | ||
new TextLoader().load("TextLoader").handle(result -> { | ||
switch (result) { | ||
case Success(text): new Printer(text); | ||
default: | ||
} | ||
}); | ||
} | ||
} | ||
|
||
// Rename this class and observe that examples 1 and 2 are updated, but the others are not. | ||
class Printer { | ||
public function new(text:String) { | ||
Browser.console.log(text); | ||
} | ||
} | ||
|
||
class TextLoader { | ||
public function new() {} | ||
|
||
public function load(text:String):Promise<String> { | ||
return Promise.resolve(text); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
package classes; | ||
|
||
import refactor.discover.Identifier; | ||
import testcases.classes.Printer; | ||
import classes.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package testcases.classes.pack; | ||
|
||
import testcases.classes.Printer; | ||
|
||
function usingPrinter() { | ||
new TextLoader(); | ||
} |