diff -Nru haxe-4.1.4/debian/changelog haxe-4.1.5/debian/changelog --- haxe-4.1.4/debian/changelog 2020-09-20 15:24:55.000000000 +0000 +++ haxe-4.1.5/debian/changelog 2021-01-05 14:45:12.000000000 +0000 @@ -1,4 +1,10 @@ -haxe (1:4.1.4-1) UNRELEASED; urgency=medium +haxe (1:4.1.5-1) unstable; urgency=medium + + * New upstream version. + + -- Andy Li Tue, 05 Jan 2021 22:45:12 +0800 + +haxe (1:4.1.4-1) unstable; urgency=medium * New upstream version. diff -Nru haxe-4.1.4/extra/azure-pipelines/build-mac.yml haxe-4.1.5/extra/azure-pipelines/build-mac.yml --- haxe-4.1.4/extra/azure-pipelines/build-mac.yml 2020-09-20 14:35:11.000000000 +0000 +++ haxe-4.1.5/extra/azure-pipelines/build-mac.yml 2021-01-05 14:48:57.000000000 +0000 @@ -15,9 +15,13 @@ submodules: recursive - script: | set -ex + # brew uninstall openssl@1.0.2t + # brew uninstall python@2.7.17 + # brew untap local/openssl + # brew untap local/python2 brew update || brew update || brew update - brew unlink python@2 - brew bundle --file=tests/Brewfile --no-upgrade + # brew unlink python@2 + brew bundle --file=tests/Brewfile --no-upgrade || brew link --overwrite awscli displayName: Install dependencies - template: install-neko-snapshot.yaml parameters: diff -Nru haxe-4.1.4/extra/CHANGES.txt haxe-4.1.5/extra/CHANGES.txt --- haxe-4.1.4/extra/CHANGES.txt 2020-09-20 14:35:11.000000000 +0000 +++ haxe-4.1.5/extra/CHANGES.txt 2021-01-05 14:48:57.000000000 +0000 @@ -1,3 +1,22 @@ +2020-12-31 4.1.5: + + General improvements: + + all : added an argument to `haxe.CallStack.exceptionStack` to return full stack up to the topmost call (#9947) + php : compatibility with PHP 8 + + Bugfixes: + + all : fixed empty object declarations in array comprehension (#9971) + jvm : fixed equality checks for `Null` and `Null` (#9897) + hl : fixed crash if a thread finishes without invoking `sendMessage`/`readMessage` (#9920) + php : fixed local vars with certain names (_SERVER, _GET etc) overriding super global values (#9924) + php : fixed generation with directories in `-D php-front`. For example `-D php-front=sub/index.php` (#10037) + macro : added return type hint to haxe.macro.MacroStringTools.formatString (#9928) + cs : fixed catching exceptions from static closures (#9957) + eval : fixed `Std.random(arg)` for `arg` values of more than 30 bits (#9974) + js : fixed `haxe.CallStack.exceptionStack` (#9968) + 2020-09-11 4.1.4: General improvements: diff -Nru haxe-4.1.4/libs/pcre/pcre_stubs.c haxe-4.1.5/libs/pcre/pcre_stubs.c --- haxe-4.1.4/libs/pcre/pcre_stubs.c 2020-09-20 14:35:12.000000000 +0000 +++ haxe-4.1.5/libs/pcre/pcre_stubs.c 2021-01-05 14:48:57.000000000 +0000 @@ -21,7 +21,6 @@ */ #if defined(_WIN32) -# define snprintf _snprintf # if defined(_DLL) # define PCREextern __declspec(dllexport) # else diff -Nru haxe-4.1.4/libs/ttflib/tTFSwfWriter.ml haxe-4.1.5/libs/ttflib/tTFSwfWriter.ml --- haxe-4.1.4/libs/ttflib/tTFSwfWriter.ml 2020-09-20 14:35:12.000000000 +0000 +++ haxe-4.1.5/libs/ttflib/tTFSwfWriter.ml 2021-01-05 14:48:57.000000000 +0000 @@ -162,8 +162,9 @@ IO.write_bits b 1 (bi f2.font_is_italic); IO.write_bits b 1 (bi f2.font_is_bold); IO.write_byte ch (int_from_langcode f2.font_language); - IO.write_byte ch (String.length f2.font_name); + IO.write_byte ch ((String.length f2.font_name) + 1); IO.nwrite_string ch f2.font_name; + IO.write_byte ch 0; IO.write_ui16 ch (Array.length f2.font_glyphs); let glyph_offset = ref (((Array.length f2.font_glyphs) * 4)+4) in Array.iter (fun g -> diff -Nru haxe-4.1.4/opam haxe-4.1.5/opam --- haxe-4.1.4/opam 2020-09-20 14:35:12.000000000 +0000 +++ haxe-4.1.5/opam 2021-01-05 14:48:57.000000000 +0000 @@ -1,6 +1,6 @@ opam-version: "2.0" name: "haxe" -version: "4.1.4" +version: "4.1.5" synopsis: "Multi-target universal programming language" description: """ Haxe is an open source toolkit based on a modern, diff -Nru haxe-4.1.4/src/core/globals.ml haxe-4.1.5/src/core/globals.ml --- haxe-4.1.4/src/core/globals.ml 2020-09-20 14:35:12.000000000 +0000 +++ haxe-4.1.5/src/core/globals.ml 2021-01-05 14:48:57.000000000 +0000 @@ -24,7 +24,7 @@ | Hl | Eval -let version = 4104 +let version = 4105 let version_major = version / 1000 let version_minor = (version mod 1000) / 100 let version_revision = (version mod 100) diff -Nru haxe-4.1.4/src/generators/genjvm.ml haxe-4.1.5/src/generators/genjvm.ml --- haxe-4.1.4/src/generators/genjvm.ml 2020-09-20 14:35:13.000000000 +0000 +++ haxe-4.1.5/src/generators/genjvm.ml 2021-01-05 14:48:57.000000000 +0000 @@ -995,7 +995,14 @@ (fun () -> jm#get_code#pop; self#texpr rvalue_any e2; - self#boolop (CmpSpecial (jm#get_code#if_nonnull sig2)) + match op with + | CmpEq | CmpGe | CmpLe -> + self#boolop (CmpSpecial (jm#get_code#if_nonnull sig2)) + | CmpNe -> + self#boolop (CmpSpecial (jm#get_code#if_null sig2)) + | _ -> + jm#get_code#pop; + jm#get_code#bconst false ) (fun () -> jm#cast ~not_null:true cast_type; diff -Nru haxe-4.1.4/src/generators/genphp7.ml haxe-4.1.5/src/generators/genphp7.ml --- haxe-4.1.4/src/generators/genphp7.ml 2020-09-20 14:35:13.000000000 +0000 +++ haxe-4.1.5/src/generators/genphp7.ml 2021-01-05 14:48:57.000000000 +0000 @@ -57,6 +57,14 @@ copy_loop (); Unix.close fd_in; Unix.close fd_out +(** + Splits `"path/to/file"` into `["path"; "to"; "file"]` +*) +let split_file_path path = + if Globals.is_windows then + (Str.split (Str.regexp "[/\\]") path) + else + (Str.split (Str.regexp "/") path) type used_type = { ut_alias : string; @@ -182,6 +190,15 @@ let get_real_name name = if is_keyword name then name ^ "_hx" else name (** + Returns local variable name free of risk to collide with superglobals like $_SERVER or $_GET +*) +let vname name = + match name with + | "GLOBALS" | "_SERVER" | "_GET" | "_POST" | "_FILES" | "_COOKIE" + | "_SESSION" | "_REQUEST" | "_ENV" -> name ^ "_hx_" + | _ -> name + +(** If `path` contains some reserved in PHP words, they will be replaced with allowed words. *) let get_real_path path = List.map get_real_name path @@ -540,6 +557,42 @@ write_args str_writer arg_writer rest (** + PHP 8 doesn't allow mandatory arguments after optional arguments. + This function makes optional arguments mandatory from left to right + unless there are no more mandatory arguments left to the end of args list. + + E.g `(a:String = null, b:Int, c:Bool = false)` is changed into `(a:String, b:Int, c:Bool = false)` +*) +let fix_optional_args is_optional to_mandatory args = + let rec find_last_mandatory args i result = + match args with + | [] -> + result + | a :: args -> + find_last_mandatory args (i + 1) (if is_optional a then result else i) + in + let last_mandatory = find_last_mandatory args 0 (-1) in + List.mapi (fun i a -> if i <= last_mandatory && is_optional a then to_mandatory a else a ) args + +let fix_tfunc_args args = + fix_optional_args + (fun a -> Option.is_some (snd a)) + (fun (v,_) -> (v,None)) + args + +let fix_tsignature_args args = + fix_optional_args + (fun (_,optional,_) -> optional) + (fun (name,_,t) -> (name,false,t)) + args + +(** + Escapes all "$" chars and encloses `str` into double quotes +*) +let quote_string str = + "\"" ^ (Str.global_replace (Str.regexp "\\$") "\\$" (String.escaped str)) ^ "\"" + +(** Check if specified field is a var with non-constant expression *) let is_var_with_nonconstant_expr (field:tclass_field) = @@ -608,6 +661,18 @@ | _ -> false (** + Check if `expr` is a constant zero +*) +let is_constant_zero expr = + try + match expr.eexpr with + | TConst (TInt i) when i = Int32.zero -> true + | TConst (TFloat s) when float_of_string s = 0.0 -> true + | _ -> false + with _ -> + false + +(** Check if `expr` is a concatenation *) let is_concatenation expr = @@ -1546,8 +1611,8 @@ (match expr.eexpr with | TConst const -> self#write_expr_const const | TLocal var -> - vars#used var.v_name; - self#write ("$" ^ var.v_name) + vars#used (vname var.v_name); + self#write ("$" ^ (vname var.v_name)) | TArray (target, index) -> self#write_expr_array_access target index | TBinop (OpAssign, { eexpr = TArray (target, index) }, value) when is_array_type target.etype -> self#write_expr_set_array_item target index value @@ -1700,8 +1765,8 @@ Writes TVar to output buffer *) method write_expr_var var expr = - vars#declared var.v_name; - self#write ("$" ^ var.v_name ^ " = "); + vars#declared (vname var.v_name); + self#write ("$" ^ (vname var.v_name) ^ " = "); match expr with | None -> self#write "null" | Some expr -> self#write_expr expr @@ -1716,7 +1781,7 @@ method write_closure_declaration func write_arg = vars#dive; self#write "function ("; - write_args self#write write_arg func.tf_args; + write_args self#write write_arg (fix_tfunc_args func.tf_args); self#write ")"; (* Generate closure body to separate buffer *) let original_buffer = buffer in @@ -1884,8 +1949,8 @@ let rec traverse = function | [] -> () | (v,body) :: rest -> - self#write (" catch(" ^ (self#use_t v.v_type) ^ " $" ^ v.v_name ^ ") "); - vars#declared v.v_name; + self#write (" catch(" ^ (self#use_t v.v_type) ^ " $" ^ (vname v.v_name) ^ ") "); + vars#declared (vname v.v_name); self#write_as_block body; traverse rest in @@ -2081,6 +2146,8 @@ write_method ((self#use boot_type_path) ^ "::shiftRightUnsigned") | OpGt | OpGte | OpLt | OpLte -> compare (" " ^ (Ast.s_binop operation) ^ " ") + | OpDiv when is_constant_zero (reveal_expr_with_parenthesis expr2) -> + write_method ((self#use boot_type_path) ^ "::divByZero") | _ -> write_binop (" " ^ (Ast.s_binop operation) ^ " ") (** @@ -2525,7 +2592,7 @@ if add_parentheses then self#write "("; self#write_expr collection; if add_parentheses then self#write ")"; - self#write (" as $" ^ key.v_name ^ " => $" ^ value.v_name ^ ") "); + self#write (" as $" ^ (vname key.v_name) ^ " => $" ^ (vname value.v_name) ^ ") "); self#write_as_block ~unset_locals:true { body with eexpr = TBlock body_exprs }; | _ -> fail self#pos __LOC__ @@ -2767,9 +2834,9 @@ method write_function_arg arg = match arg with | ({ v_name = arg_name; v_type = arg_type }, default_value) -> - vars#declared arg_name; + vars#declared (vname arg_name); if is_ref arg_type then self#write "&"; - self#write ("$" ^ arg_name); + self#write ("$" ^ (vname arg_name)); match default_value with | None -> () | Some expr -> @@ -3042,7 +3109,7 @@ method private write_constructor_declaration func = if self#extends_no_constructor then writer#extends_no_constructor; writer#write ("function __construct ("); - write_args writer#write writer#write_function_arg func.tf_args; + write_args writer#write writer#write_function_arg (fix_tfunc_args func.tf_args); writer#write ") {\n"; writer#indent_more; self#write_instance_initialization; @@ -3063,7 +3130,7 @@ else func.tf_args in - write_args writer#write writer#write_function_arg args; + write_args writer#write writer#write_function_arg (fix_tfunc_args args); writer#write ") "; if not (self#write_body_if_special_method name) then writer#write_expr (inject_defaults ctx func) @@ -3180,7 +3247,7 @@ writer#indent 1; self#write_doc (DocMethod (args, TEnum (enm, []), (gen_doc_text_opt field.ef_doc))); writer#write_with_indentation ("static public function " ^ name ^ " ("); - write_args writer#write (writer#write_arg true) args; + write_args writer#write (writer#write_arg true) (fix_tsignature_args args); writer#write ") {\n"; writer#indent_more; let index_str = string_of_int field.ef_index in @@ -3650,7 +3717,7 @@ | None -> if is_static then writer#write "static "; writer#write ("function " ^ (field_name field) ^ " ("); - write_args writer#write (writer#write_arg true) args; + write_args writer#write (writer#write_arg true) (fix_tsignature_args args); writer#write ")"; writer#write " ;\n" | Some { eexpr = TFunction fn } -> @@ -3673,11 +3740,11 @@ (match field.cf_expr with | None -> (* interface *) writer#write " ("; - write_args writer#write (writer#write_arg true) args; + write_args writer#write (writer#write_arg true) (fix_tsignature_args args); writer#write ");\n"; | Some { eexpr = TFunction fn } -> (* normal class *) writer#write " ("; - write_args writer#write writer#write_function_arg fn.tf_args; + write_args writer#write writer#write_function_arg (fix_tfunc_args fn.tf_args); writer#write ")\n"; writer#write_line "{"; writer#indent_more; @@ -3830,11 +3897,18 @@ | None -> () | Some (uses, entry_point) -> let filename = Common.defined_value_safe ~default:"index.php" ctx.pgc_common Define.PhpFront in + let front_dirs = split_file_path (Filename.dirname filename) in + if front_dirs <> [] then + ignore(create_dir_recursive (root_dir :: front_dirs)); + let lib_path = + (String.concat "" (List.fold_left (fun acc s -> if s <> "." then "../" :: acc else acc) [] front_dirs)) + ^ (String.concat "/" self#get_lib_path) + in let channel = open_out (root_dir ^ "/" ^ filename) in output_string channel " - let v = decode_int v in - vint (Random.State.int random (if v <= 0 then 1 else v)) + let v = decode_i32 v in + vint32 (Random.State.int32 random (if v <= Int32.zero then Int32.one else v)) ); end diff -Nru haxe-4.1.4/src/typing/typer.ml haxe-4.1.5/src/typing/typer.ml --- haxe-4.1.4/src/typing/typer.ml 2020-09-20 14:35:13.000000000 +0000 +++ haxe-4.1.5/src/typing/typer.ml 2021-01-05 14:48:57.000000000 +0000 @@ -2174,6 +2174,7 @@ | EIf (cond,e2,None) -> (EIf (cond,map_compr e2,None),p) | EIf (cond,e2,Some e3) -> (EIf (cond,map_compr e2,Some (map_compr e3)),p) | EBlock [e] -> (EBlock [map_compr e],p) + | EBlock [] -> map_compr (EObjectDecl [],p) | EBlock el -> begin match List.rev el with | e :: el -> (EBlock ((List.rev el) @ [map_compr e]),p) | [] -> e,p diff -Nru haxe-4.1.4/std/cs/internal/Runtime.hx haxe-4.1.5/std/cs/internal/Runtime.hx --- haxe-4.1.4/std/cs/internal/Runtime.hx 2020-09-20 14:35:14.000000000 +0000 +++ haxe-4.1.5/std/cs/internal/Runtime.hx 2021-01-05 14:48:57.000000000 +0000 @@ -475,17 +475,26 @@ tgs[i] = untyped __typeof__(Dynamic); } m = m.MakeGenericMethod(tgs); - var retg = m.Invoke(obj, oargs); + var retg = try + m.Invoke(obj, oargs) + catch(e:TargetInvocationException) + throw e.InnerException; return cs.internal.Runtime.unbox(retg); } var m = methods[0]; if (obj == null && Std.isOfType(m, cs.system.reflection.ConstructorInfo)) { - var ret = cast(m, cs.system.reflection.ConstructorInfo).Invoke(oargs); + var ret = try + cast(m, cs.system.reflection.ConstructorInfo).Invoke(oargs) + catch(e:TargetInvocationException) + throw e.InnerException; return unbox(ret); } - var ret = m.Invoke(obj, oargs); + var ret = try + m.Invoke(obj, oargs) + catch(e:TargetInvocationException) + throw e.InnerException; return unbox(ret); } diff -Nru haxe-4.1.4/std/haxe/CallStack.hx haxe-4.1.5/std/haxe/CallStack.hx --- haxe-4.1.4/std/haxe/CallStack.hx 2020-09-20 14:35:18.000000000 +0000 +++ haxe-4.1.5/std/haxe/CallStack.hx 2021-01-05 14:48:57.000000000 +0000 @@ -56,12 +56,13 @@ Return the exception stack : this is the stack elements between the place the last exception was thrown and the place it was caught, or an empty array if not available. + Set `fullStack` parameter to true in order to return the full exception stack. May not work if catch type was a derivative from `haxe.Exception`. **/ - public static function exceptionStack():Array { + public static function exceptionStack( fullStack = false ):Array { var eStack:CallStack = NativeStackTrace.toHaxe(NativeStackTrace.exceptionStack()); - return eStack.subtract(callStack()).asArray(); + return (fullStack ? eStack : eStack.subtract(callStack())).asArray(); } /** @@ -181,4 +182,4 @@ b.add(n); } } -} \ No newline at end of file +} diff -Nru haxe-4.1.4/std/haxe/macro/MacroStringTools.hx haxe-4.1.5/std/haxe/macro/MacroStringTools.hx --- haxe-4.1.4/std/haxe/macro/MacroStringTools.hx 2020-09-20 14:35:18.000000000 +0000 +++ haxe-4.1.5/std/haxe/macro/MacroStringTools.hx 2021-01-05 14:48:57.000000000 +0000 @@ -39,7 +39,7 @@ The returned expression is a concatenation of string parts and escaped elements. **/ - static public function formatString(s:String, pos:Position) { + static public function formatString(s:String, pos:Position):Expr { #if (neko || eval) return Context.load("format_string", 2)(s, pos); #end diff -Nru haxe-4.1.4/std/hl/_std/sys/thread/Thread.hx haxe-4.1.5/std/hl/_std/sys/thread/Thread.hx --- haxe-4.1.4/std/hl/_std/sys/thread/Thread.hx 2020-09-20 14:35:19.000000000 +0000 +++ haxe-4.1.5/std/hl/_std/sys/thread/Thread.hx 2021-01-05 14:48:57.000000000 +0000 @@ -69,6 +69,8 @@ } static inline function dropThread(handle:ThreadHandle) { + if( queue_mutex == null ) + return; queue_mutex.acquire(); for (i => tq in threads_queues) { if (tq.t == handle) { diff -Nru haxe-4.1.4/std/js/_std/haxe/Exception.hx haxe-4.1.5/std/js/_std/haxe/Exception.hx --- haxe-4.1.4/std/js/_std/haxe/Exception.hx 2020-09-20 14:35:20.000000000 +0000 +++ haxe-4.1.5/std/js/_std/haxe/Exception.hx 2021-01-05 14:48:57.000000000 +0000 @@ -97,6 +97,7 @@ return __nativeException; } + @:ifFeature('haxe.NativeStackTrace.exceptionStack') function get_stack():CallStack { return switch __exceptionStack { case null: diff -Nru haxe-4.1.4/std/php/Boot.hx haxe-4.1.5/std/php/Boot.hx --- haxe-4.1.4/std/php/Boot.hx 2020-09-20 14:35:28.000000000 +0000 +++ haxe-4.1.5/std/php/Boot.hx 2021-01-05 14:48:57.000000000 +0000 @@ -107,7 +107,8 @@ Check if specified property has getter **/ public static function hasGetter(phpClassName:String, property:String):Bool { - ensureLoaded(phpClassName); + if(!ensureLoaded(phpClassName)) + return false; var has = false; var phpClassName:haxe.extern.EitherType = phpClassName; @@ -123,7 +124,8 @@ Check if specified property has setter **/ public static function hasSetter(phpClassName:String, property:String):Bool { - ensureLoaded(phpClassName); + if(!ensureLoaded(phpClassName)) + return false; var has = false; var phpClassName:haxe.extern.EitherType = phpClassName; @@ -146,7 +148,7 @@ Retrieve metadata for specified class **/ public static function getMeta(phpClassName:String):Null { - ensureLoaded(phpClassName); + if(!ensureLoaded(phpClassName)) return null; return Global.isset(meta[phpClassName]) ? meta[phpClassName] : null; } @@ -645,6 +647,10 @@ return ((code - 0xF0) << 18) + ((Global.ord(s[1]) - 0x80) << 12) + ((Global.ord(s[2]) - 0x80) << 6) + Global.ord(s[3]) - 0x80; } } + + static public function divByZero(value:Float):Float { + return value == 0 ? Const.NAN : (value < 0 ? -Const.INF : Const.INF); + } } /** diff -Nru haxe-4.1.4/std/php/Global.hx haxe-4.1.5/std/php/Global.hx --- haxe-4.1.4/std/php/Global.hx 2020-09-20 14:35:28.000000000 +0000 +++ haxe-4.1.5/std/php/Global.hx 2021-01-05 14:48:57.000000000 +0000 @@ -968,6 +968,11 @@ static function spl_object_hash(obj:{}):String; /** + @see http://php.net/manual/en/function.spl-object-id.php + **/ + static function spl_object_id(obj:{}):Int; + + /** @see http://php.net/manual/en/function.spl-autoload-call.php **/ static function spl_autoload_call(class_name:String):Void; diff -Nru haxe-4.1.4/std/php/_std/sys/io/Process.hx haxe-4.1.5/std/php/_std/sys/io/Process.hx --- haxe-4.1.4/std/php/_std/sys/io/Process.hx 2020-09-20 14:35:28.000000000 +0000 +++ haxe-4.1.5/std/php/_std/sys/io/Process.hx 2021-01-05 14:48:57.000000000 +0000 @@ -151,7 +151,9 @@ } while (running) { var arr = Syntax.arrayDecl(process); - Syntax.suppress(Global.stream_select(arr, arr, arr, null)); + try { + Syntax.suppress(Global.stream_select(arr, arr, arr, null)); + } catch(_) {} updateStatus(); } return _exitCode; diff -Nru haxe-4.1.4/std/php/_std/sys/net/Socket.hx haxe-4.1.5/std/php/_std/sys/net/Socket.hx --- haxe-4.1.4/std/php/_std/sys/net/Socket.hx 2020-09-20 14:35:28.000000000 +0000 +++ haxe-4.1.5/std/php/_std/sys/net/Socket.hx 2021-01-05 14:48:57.000000000 +0000 @@ -152,19 +152,30 @@ throw haxe.io.Error.Custom('Error [$code]: $msg'); } + + /** + Since PHP 8 sockets are represented as instances of class \Socket + + TODO: + rewrite without `cast` after resolving https://github.com/HaxeFoundation/haxe/issues/9964 + */ + static inline function getSocketId(s:Resource):Int { + return PHP_VERSION_ID < 80000 ? Syntax.int(s) : spl_object_id(cast s); + } + public static function select(read:Array, write:Array, others:Array, ?timeout:Float):{read:Array, write:Array, others:Array} { var map:Map = new Map(); inline function addSockets(sockets:Array) { if (sockets != null) for (s in sockets) - map[Syntax.int(s.__s)] = s; + map[getSocketId(s.__s)] = s; } inline function getRaw(sockets:Array):Array { return sockets == null ? [] : [for (s in sockets) s.__s]; } inline function getOriginal(result:Array) { - return [for (r in result) map[Syntax.int(r)]]; + return [for (r in result) map[getSocketId(r)]]; } addSockets(read); diff -Nru haxe-4.1.4/std/php/_std/Type.hx haxe-4.1.5/std/php/_std/Type.hx --- haxe-4.1.4/std/php/_std/Type.hx 2020-09-20 14:35:28.000000000 +0000 +++ haxe-4.1.5/std/php/_std/Type.hx 2021-01-05 14:48:57.000000000 +0000 @@ -59,7 +59,11 @@ public static function getSuperClass(c:Class):Class { if (c == null) return null; - var parentClass = Global.get_parent_class((cast c).phpClassName); + var parentClass = try { + Global.get_parent_class((cast c).phpClassName); + } catch(e) { + return null; + } if (!parentClass) return null; return cast Boot.getClass(parentClass); diff -Nru haxe-4.1.4/tests/misc/php/projects/Issue10037/compile.hxml haxe-4.1.5/tests/misc/php/projects/Issue10037/compile.hxml --- haxe-4.1.4/tests/misc/php/projects/Issue10037/compile.hxml 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.1.5/tests/misc/php/projects/Issue10037/compile.hxml 2021-01-05 14:48:57.000000000 +0000 @@ -0,0 +1,6 @@ +-cp src +-main Main +-dce full +-php bin +-D php-front=public/index.php +--cmd php bin/public/index.php \ No newline at end of file diff -Nru haxe-4.1.4/tests/misc/php/projects/Issue10037/src/Main.hx haxe-4.1.5/tests/misc/php/projects/Issue10037/src/Main.hx --- haxe-4.1.4/tests/misc/php/projects/Issue10037/src/Main.hx 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.1.5/tests/misc/php/projects/Issue10037/src/Main.hx 2021-01-05 14:48:57.000000000 +0000 @@ -0,0 +1,10 @@ +import pack.Sub; + +class Main { + static public var test:Int; + + static function main() { + test = Sub.test; + Sub.test = test; + } +} \ No newline at end of file diff -Nru haxe-4.1.4/tests/misc/php/projects/Issue10037/src/pack/Sub.hx haxe-4.1.5/tests/misc/php/projects/Issue10037/src/pack/Sub.hx --- haxe-4.1.4/tests/misc/php/projects/Issue10037/src/pack/Sub.hx 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.1.5/tests/misc/php/projects/Issue10037/src/pack/Sub.hx 2021-01-05 14:48:57.000000000 +0000 @@ -0,0 +1,5 @@ +package pack; + +class Sub { + static public var test:Int = 10; +} \ No newline at end of file diff -Nru haxe-4.1.4/tests/misc/projects/Issue9968/compile.hxml haxe-4.1.5/tests/misc/projects/Issue9968/compile.hxml --- haxe-4.1.4/tests/misc/projects/Issue9968/compile.hxml 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.1.5/tests/misc/projects/Issue9968/compile.hxml 2021-01-05 14:48:57.000000000 +0000 @@ -0,0 +1,5 @@ +--main Main +--dce full +--js bin/test.js + +--cmd node bin/test.js diff -Nru haxe-4.1.4/tests/misc/projects/Issue9968/Main.hx haxe-4.1.5/tests/misc/projects/Issue9968/Main.hx --- haxe-4.1.4/tests/misc/projects/Issue9968/Main.hx 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.1.5/tests/misc/projects/Issue9968/Main.hx 2021-01-05 14:48:57.000000000 +0000 @@ -0,0 +1,17 @@ +class Main { + static function main() { + try { + test(); + } + catch (e:Dynamic) { + var stack = haxe.CallStack.exceptionStack(); + if(stack.length == 0) { + throw 'haxe.CallStack.exceptionStack() returned empty array'; + } + } + } + + static public function test() { + throw 'sdffsd'; + } +} \ No newline at end of file diff -Nru haxe-4.1.4/tests/misc/projects/Issue9971/compile-fail.hxml haxe-4.1.5/tests/misc/projects/Issue9971/compile-fail.hxml --- haxe-4.1.4/tests/misc/projects/Issue9971/compile-fail.hxml 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.1.5/tests/misc/projects/Issue9971/compile-fail.hxml 2021-01-05 14:48:57.000000000 +0000 @@ -0,0 +1 @@ +--main Main \ No newline at end of file diff -Nru haxe-4.1.4/tests/misc/projects/Issue9971/compile-fail.hxml.stderr haxe-4.1.5/tests/misc/projects/Issue9971/compile-fail.hxml.stderr --- haxe-4.1.4/tests/misc/projects/Issue9971/compile-fail.hxml.stderr 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.1.5/tests/misc/projects/Issue9971/compile-fail.hxml.stderr 2021-01-05 14:48:57.000000000 +0000 @@ -0,0 +1,2 @@ +Main.hx:3: characters 76-78 : Object requires fields: foo, bar +Main.hx:3: characters 76-78 : For function argument 'x' \ No newline at end of file diff -Nru haxe-4.1.4/tests/misc/projects/Issue9971/Main.hx haxe-4.1.5/tests/misc/projects/Issue9971/Main.hx --- haxe-4.1.4/tests/misc/projects/Issue9971/Main.hx 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.1.5/tests/misc/projects/Issue9971/Main.hx 2021-01-05 14:48:57.000000000 +0000 @@ -0,0 +1,5 @@ +class Main { + static function main() { + var a:Array<{ foo: Int, bar: String }> = [for (i in 0...1+Std.random(9)) {}]; + } +} \ No newline at end of file diff -Nru haxe-4.1.4/tests/runci/targets/Flash.hx haxe-4.1.5/tests/runci/targets/Flash.hx --- haxe-4.1.4/tests/runci/targets/Flash.hx 2020-09-20 14:35:45.000000000 +0000 +++ haxe-4.1.5/tests/runci/targets/Flash.hx 2021-01-05 14:48:57.000000000 +0000 @@ -76,8 +76,12 @@ if (commandResult("brew", ["cask", "list", "flash-player-debugger"]).exitCode == 0) { return; } + // runCommand("brew", ["uninstall", "openssl@1.0.2t"]); + // runCommand("brew", ["uninstall", "python@2.7.17"]); + // runCommand("brew", ["untap", "local/openssl"]); + // runCommand("brew", ["untap", "local/python2"]); runCommand("brew", ["update"]); - runCommand("brew", ["cask", "install", "flash-player-debugger"]); + runCommand("brew", ["install", "--cask", "flash-player-debugger"]); // Disable the "application downloaded from Internet" warning runCommand("xattr", ["-d", "-r", "com.apple.quarantine", "/Applications/Flash Player Debugger.app"]); diff -Nru haxe-4.1.4/tests/runci/targets/Hl.hx haxe-4.1.5/tests/runci/targets/Hl.hx --- haxe-4.1.4/tests/runci/targets/Hl.hx 2020-09-20 14:35:45.000000000 +0000 +++ haxe-4.1.5/tests/runci/targets/Hl.hx 2021-01-05 14:48:57.000000000 +0000 @@ -41,7 +41,7 @@ } FileSystem.createDirectory(hlBuild); - var generator = systemName == "Windows" ? [] : ["-GNinja"]; + var generator = systemName == "Windows" ? ["-DCMAKE_SYSTEM_VERSION=10.0.19041.0"] : ["-GNinja"]; runCommand("cmake", generator.concat([ "-DBUILD_TESTING=OFF", "-DWITH_BULLET=OFF", diff -Nru haxe-4.1.4/tests/unit/src/unit/issues/Issue6871.hx haxe-4.1.5/tests/unit/src/unit/issues/Issue6871.hx --- haxe-4.1.4/tests/unit/src/unit/issues/Issue6871.hx 2020-09-20 14:35:54.000000000 +0000 +++ haxe-4.1.5/tests/unit/src/unit/issues/Issue6871.hx 2021-01-05 14:48:57.000000000 +0000 @@ -17,14 +17,14 @@ Reflect.getProperty(Issue6871, 'field'); t(false); } catch(e:Dynamic) { - eq(GETTER_ERROR, exception(e)); + eq(GETTER_ERROR, e); } try { Reflect.setProperty(Issue6871, 'field', 123); t(false); } catch(e:Dynamic) { - eq(SETTER_ERROR, exception(e)); + eq(SETTER_ERROR, e); } } } \ No newline at end of file diff -Nru haxe-4.1.4/tests/unit/src/unit/issues/Issue9897.hx haxe-4.1.5/tests/unit/src/unit/issues/Issue9897.hx --- haxe-4.1.4/tests/unit/src/unit/issues/Issue9897.hx 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.1.5/tests/unit/src/unit/issues/Issue9897.hx 2021-01-05 14:48:57.000000000 +0000 @@ -0,0 +1,11 @@ +package unit.issues; + +class Issue9897 extends unit.Test { + static var nullValue:Null = null; + static var floatValue:Null = 100; + + function test() { + t(nullValue != floatValue); + t(floatValue != nullValue); + } +} diff -Nru haxe-4.1.4/tests/unit/src/unit/issues/Issue9928.hx haxe-4.1.5/tests/unit/src/unit/issues/Issue9928.hx --- haxe-4.1.4/tests/unit/src/unit/issues/Issue9928.hx 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.1.5/tests/unit/src/unit/issues/Issue9928.hx 2021-01-05 14:48:57.000000000 +0000 @@ -0,0 +1,19 @@ +package unit.issues; +#if !macro +class Issue9928 extends unit.Test { + function test() { + var w = Std.random(10); + eq('hello $w', format('hello $w')); + } + + macro static function format(s:String):haxe.macro.Expr; +} +#else +class Issue9928 extends unit.Test { + macro static function format(s:String):haxe.macro.Expr { + var p = haxe.macro.Context.currentPos(); + var ed:{expr:haxe.macro.Expr.ExprDef} = haxe.macro.MacroStringTools.formatString(s, p); + return haxe.macro.MacroStringTools.formatString(s, p); + } +} +#end \ No newline at end of file diff -Nru haxe-4.1.4/tests/unit/src/unit/issues/Issue9957.hx haxe-4.1.5/tests/unit/src/unit/issues/Issue9957.hx --- haxe-4.1.4/tests/unit/src/unit/issues/Issue9957.hx 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.1.5/tests/unit/src/unit/issues/Issue9957.hx 2021-01-05 14:48:57.000000000 +0000 @@ -0,0 +1,32 @@ +package unit.issues; + +class Issue9957 extends unit.Test { + function test() { + var stat = staticExc; + var inst = instanceExc; + + try { + try stat() + catch(_:MyEx) noAssert(); + } catch(_) { + assert("Can't catch exceptions from static closures"); + } + + try { + try inst() + catch(_:MyEx) noAssert(); + } catch(_) { + assert("Can't catch exceptions from instance closures"); + } + } + + static function staticExc() { + throw new MyEx(''); + } + + function instanceExc() { + throw new MyEx(''); + } +} + +private class MyEx extends haxe.Exception {} \ No newline at end of file diff -Nru haxe-4.1.4/tests/unit/src/unit/issues/Issue9974.hx haxe-4.1.5/tests/unit/src/unit/issues/Issue9974.hx --- haxe-4.1.4/tests/unit/src/unit/issues/Issue9974.hx 1970-01-01 00:00:00.000000000 +0000 +++ haxe-4.1.5/tests/unit/src/unit/issues/Issue9974.hx 2021-01-05 14:48:57.000000000 +0000 @@ -0,0 +1,10 @@ +package unit.issues; + +class Issue9974 extends unit.Test { +#if !neko + function test() { + var r = Std.random(0x7FFFFFFF); + t(r >= 0); + } +#end +} \ No newline at end of file diff -Nru haxe-4.1.4/tests/unit/src/unit/TestPhp.hx haxe-4.1.5/tests/unit/src/unit/TestPhp.hx --- haxe-4.1.4/tests/unit/src/unit/TestPhp.hx 2020-09-20 14:35:48.000000000 +0000 +++ haxe-4.1.5/tests/unit/src/unit/TestPhp.hx 2021-01-05 14:48:57.000000000 +0000 @@ -85,6 +85,31 @@ }); } + @:analyzer(ignore) + function testIssue9924() { + var v = Std.random(10); + + var GLOBALS = v; + var _SERVER = v; + var _GET = v; + var _POST = v; + var _FILES = v; + var _COOKIE = v; + var _REQUEST = v; + var _ENV = v; + // var _SESSION = v; //not defined in CLI + + utest.Assert.notEquals(GLOBALS, SuperGlobal.GLOBALS); + utest.Assert.notEquals(_SERVER, SuperGlobal._SERVER); + utest.Assert.notEquals(_GET, SuperGlobal._GET); + utest.Assert.notEquals(_POST, SuperGlobal._POST); + utest.Assert.notEquals(_FILES, SuperGlobal._FILES); + utest.Assert.notEquals(_COOKIE, SuperGlobal._COOKIE); + utest.Assert.notEquals(_REQUEST, SuperGlobal._REQUEST); + utest.Assert.notEquals(_ENV, SuperGlobal._ENV); + // utest.Assert.notEquals(_SESSION, SuperGlobal._SESSION); + } + inline static function make():FunctionCallerWrapper { return new FunctionCaller(function(f) f()); }