-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# [0.7.0](0.6.8...0.7.0) (2022-12-03) ### Features * setup esm and cjs builds. ([fc3f381](fc3f381))
- Loading branch information
1 parent
e6d9899
commit 6848e82
Showing
10 changed files
with
240 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(function ($hx_exports, $global) { "use strict"; | ||
$hx_exports["dropecho"] = $hx_exports["dropecho"] || {}; | ||
$hx_exports["dropecho"]["lib_example"] = $hx_exports["dropecho"]["lib_example"] || {}; | ||
class dropecho_lib_$example_LibExample { | ||
static test() { | ||
console.log("src/dropecho/lib_example/LibExample.hx:6:","hello world."); | ||
return 2; | ||
} | ||
} | ||
$hx_exports["dropecho"]["lib_example"]["LibExample"] = dropecho_lib_$example_LibExample; | ||
class dropecho_lib_$example_OtherExample { | ||
constructor() { | ||
this.x = 0; | ||
} | ||
banana(b) { | ||
return b + 5 + this.x; | ||
} | ||
} | ||
$hx_exports["dropecho"]["lib_example"]["OtherExample"] = dropecho_lib_$example_OtherExample; | ||
class haxe_iterators_ArrayIterator { | ||
constructor(array) { | ||
this.current = 0; | ||
this.array = array; | ||
} | ||
hasNext() { | ||
return this.current < this.array.length; | ||
} | ||
next() { | ||
return this.array[this.current++]; | ||
} | ||
} | ||
{ | ||
} | ||
})(typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, {}); |
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,18 @@ | ||
import {Register} from "./genes/Register.js" | ||
|
||
/** | ||
The Std class provides standard methods for manipulating basic types. | ||
*/ | ||
export const Std = Register.global("$hxClasses")["Std"] = | ||
class Std { | ||
static get __name__() { | ||
return "Std" | ||
} | ||
get __class__() { | ||
return Std | ||
} | ||
} | ||
|
||
|
||
;{ | ||
} |
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,16 @@ | ||
import {Register} from "../../genes/Register.js" | ||
|
||
export const LibExample = Register.global("$hxClasses")["dropecho.lib_example.LibExample"] = | ||
class LibExample { | ||
static test() { | ||
console.log("src/dropecho/lib_example/LibExample.hx:6:","hello world."); | ||
return 2; | ||
} | ||
static get __name__() { | ||
return "dropecho.lib_example.LibExample" | ||
} | ||
get __class__() { | ||
return LibExample | ||
} | ||
} | ||
|
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,18 @@ | ||
import {Register} from "../../genes/Register.js" | ||
|
||
export const OtherExample = Register.global("$hxClasses")["dropecho.lib_example.OtherExample"] = | ||
class OtherExample extends Register.inherits() { | ||
new() { | ||
this.x = 0; | ||
} | ||
banana(b) { | ||
return b + 5 + this.x; | ||
} | ||
static get __name__() { | ||
return "dropecho.lib_example.OtherExample" | ||
} | ||
get __class__() { | ||
return OtherExample | ||
} | ||
} | ||
|
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,107 @@ | ||
|
||
export class Register { | ||
static global(name) { | ||
if (Register.globals[name]) { | ||
return Register.globals[name]; | ||
} else { | ||
return Register.globals[name] = {}; | ||
}; | ||
} | ||
static createStatic(obj, name, get) { | ||
var value = null; | ||
Object.defineProperty(obj, name, {"enumerable": true, "get": function () { | ||
if (get != null) { | ||
value = get(); | ||
get = null; | ||
}; | ||
return value; | ||
}, "set": function (v) { | ||
if (get != null) { | ||
value = get(); | ||
get = null; | ||
}; | ||
value = v; | ||
}}); | ||
} | ||
static iter(a) { | ||
if (!Array.isArray(a)) { | ||
return a.iterator(); | ||
} else { | ||
return {"cur": 0, "arr": a, "hasNext": function () { | ||
return this.cur < this.arr.length; | ||
}, "next": function () { | ||
return this.arr[this.cur++]; | ||
}}; | ||
}; | ||
} | ||
static extend(superClass) { | ||
|
||
function res() { | ||
this.new.apply(this, arguments) | ||
} | ||
Object.setPrototypeOf(res.prototype, superClass.prototype) | ||
return res | ||
; | ||
} | ||
static inherits(resolve, defer) { | ||
if (defer == null) { | ||
defer = false; | ||
}; | ||
|
||
function res() { | ||
if (defer && resolve && res.__init__) res.__init__() | ||
this.new.apply(this, arguments) | ||
} | ||
if (!defer) { | ||
if (resolve && resolve.__init__) { | ||
defer = true | ||
res.__init__ = () => { | ||
resolve.__init__() | ||
Object.setPrototypeOf(res.prototype, resolve.prototype) | ||
res.__init__ = undefined | ||
} | ||
} else if (resolve) { | ||
Object.setPrototypeOf(res.prototype, resolve.prototype) | ||
} | ||
} else { | ||
res.__init__ = () => { | ||
const superClass = resolve() | ||
if (superClass.__init__) superClass.__init__() | ||
Object.setPrototypeOf(res.prototype, superClass.prototype) | ||
res.__init__ = undefined | ||
} | ||
} | ||
return res | ||
; | ||
} | ||
static bind(o, m) { | ||
if (m == null) { | ||
return null; | ||
}; | ||
if (m.__id__ == null) { | ||
m.__id__ = Register.fid++; | ||
}; | ||
var f = null; | ||
if (o.hx__closures__ == null) { | ||
o.hx__closures__ = {}; | ||
} else { | ||
f = o.hx__closures__[m.__id__]; | ||
}; | ||
if (f == null) { | ||
f = m.bind(o); | ||
o.hx__closures__[m.__id__] = f; | ||
}; | ||
return f; | ||
} | ||
static get __name__() { | ||
return "genes.Register" | ||
} | ||
get __class__() { | ||
return Register | ||
} | ||
} | ||
|
||
|
||
Register.$global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : undefined | ||
Register.globals = {} | ||
Register.fid = 0 |
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,33 @@ | ||
import {Register} from "../../genes/Register.js" | ||
|
||
/** | ||
This iterator is used only when `Array<T>` is passed to `Iterable<T>` | ||
*/ | ||
export const ArrayIterator = Register.global("$hxClasses")["haxe.iterators.ArrayIterator"] = | ||
class ArrayIterator extends Register.inherits() { | ||
new(array) { | ||
this.current = 0; | ||
this.array = array; | ||
} | ||
|
||
/** | ||
See `Iterator.hasNext` | ||
*/ | ||
hasNext() { | ||
return this.current < this.array.length; | ||
} | ||
|
||
/** | ||
See `Iterator.next` | ||
*/ | ||
next() { | ||
return this.array[this.current++]; | ||
} | ||
static get __name__() { | ||
return "haxe.iterators.ArrayIterator" | ||
} | ||
get __class__() { | ||
return ArrayIterator | ||
} | ||
} | ||
|
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,4 @@ | ||
import {Register} from "./genes/Register.js" | ||
|
||
export {OtherExample} from "./dropecho/lib_example/OtherExample.js" | ||
export {LibExample} from "./dropecho/lib_example/LibExample.js" |
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,6 +1,6 @@ | ||
{ | ||
"name": "@dropecho/lib_example", | ||
"version": "0.6.8", | ||
"version": "0.7.0", | ||
"description": "An example haxelib that outputs to multiple targets.", | ||
"author": "vantreeseba <[email protected]>", | ||
"repository": "github:dropecho/lib_example", | ||
|