This commit is contained in:
Dante
2026-05-21 23:40:20 -07:00
parent 3e2915dff7
commit 877a69d844
5737 changed files with 29796 additions and 1589684 deletions

View File

@ -62,7 +62,7 @@ class NativeStackTrace {
for (i in 0...stack.length) {
if(skip > i) continue;
var line = stack[i];
var matched:Null<Array<String>> = Syntax.code('{0}.match(/^ at ([A-Za-z0-9_. ]+) \\(([^)]+):([0-9]+):([0-9]+)\\)$/)', line);
var matched:Null<Array<String>> = Syntax.code("{0}.match(/^ at ([$A-Za-z0-9_. ]+) \\(([^)]+):([0-9]+):([0-9]+)\\)$/)", line);
if (matched != null) {
var path = matched[1].split(".");
if(path[0] == "$hxClasses") {

View File

@ -0,0 +1,50 @@
package haxe.atomic;
import js.lib.Atomics;
abstract AtomicInt(js.lib.Int32Array) {
public inline function new(value:Int) {
this = new js.lib.Int32Array(new js.lib.SharedArrayBuffer(js.lib.Int32Array.BYTES_PER_ELEMENT));
this[0] = value;
}
private function asArray():js.lib.Int32Array {
return this;
}
public inline function add(b:Int):Int {
return Atomics.add(asArray(), 0, b);
}
public inline function sub(b:Int):Int {
return Atomics.sub(asArray(), 0, b);
}
public inline function and(b:Int):Int {
return Atomics.and(asArray(), 0, b);
}
public inline function or(b:Int):Int {
return Atomics.or(asArray(), 0, b);
}
public inline function xor(b:Int):Int {
return Atomics.xor(asArray(), 0, b);
}
public inline function compareExchange(expected:Int, replacement:Int):Int {
return Atomics.compareExchange(asArray(), 0, expected, replacement);
}
public inline function exchange(value:Int):Int {
return Atomics.exchange(asArray(), 0, value);
}
public inline function load():Int {
return Atomics.load(asArray(), 0);
}
public inline function store(value:Int):Int {
return Atomics.store(asArray(), 0, value);
}
}

View File

@ -81,7 +81,7 @@ package haxe.ds;
public function toString():String {
var s = new StringBuf();
s.add("{");
s.add("[");
var it = keys();
for (i in it) {
s.add(i);
@ -90,7 +90,7 @@ package haxe.ds;
if (it.hasNext())
s.add(", ");
}
s.add("}");
s.add("]");
return s.toString();
}

View File

@ -27,13 +27,6 @@ import js.Lib;
@:coreApi
class ObjectMap<K:{}, V> implements haxe.Constraints.IMap<K, V> {
static var count:Int;
// initialize count through __init__ magic, because these are generated
// before normal static initializations for which ObjectMap should be ready to use
// see https://github.com/HaxeFoundation/haxe/issues/6792
static inline function __init__():Void
count = 0;
static inline function assignId(obj:{}):Int {
return Syntax.code('({0}.__id__ = {1})', obj, Lib.getNextHaxeUID());
@ -113,7 +106,7 @@ class ObjectMap<K:{}, V> implements haxe.Constraints.IMap<K, V> {
public function toString():String {
var s = new StringBuf();
s.add("{");
s.add("[");
var it = keys();
for (i in it) {
s.add(Std.string(i));
@ -122,7 +115,7 @@ class ObjectMap<K:{}, V> implements haxe.Constraints.IMap<K, V> {
if (it.hasNext())
s.add(", ");
}
s.add("}");
s.add("]");
return s.toString();
}

View File

@ -87,12 +87,12 @@ import haxe.DynamicAccess;
@:analyzer(no_optimize)
static function stringify(h:Dynamic):String {
var s = "{", first = true;
var s = "[", first = true;
js.Syntax.code("for (var key in {0}) {", h);
js.Syntax.code("\tif ({0}) {0} = false; else {1} += ',';", first, s);
js.Syntax.code("\t{0} += key + ' => ' + {1}({2}[key]);", s, Std.string, h);
js.Syntax.code("}");
return s + "}";
return s + "]";
}
}
@ -286,7 +286,7 @@ private class StringMapIterator<T> {
public function toString():String {
var s = new StringBuf();
s.add("{");
s.add("[");
var keys = arrayKeys();
for (i in 0...keys.length) {
var k = keys[i];
@ -296,7 +296,7 @@ private class StringMapIterator<T> {
if (i < keys.length - 1)
s.add(", ");
}
s.add("}");
s.add("]");
return s.toString();
}