From 8a4905be350313d41f6c0b20497809760d7fa84e Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 26 Jun 2015 12:46:54 +0300 Subject: Improve values returned by typeof. Fix tests and doc. --- builtin.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'builtin.c') diff --git a/builtin.c b/builtin.c index 1dd7dcbe..6ad4de36 100644 --- a/builtin.c +++ b/builtin.c @@ -3891,11 +3891,13 @@ do_typeof(int nargs) case Node_val: case Node_var: if (arg == Nnull_string) - res = "untyped"; - else if ((arg->flags & STRING) != 0) - res = "scalar_s"; - else if ((arg->flags & NUMBER) != 0) - res = "scalar_n"; + res = "unassigned"; + else if ((arg->flags & STRING) != 0) { + res = "string"; + if ((arg->flags & MAYBE_NUM) != 0) + res = "strnum"; + } else if ((arg->flags & NUMBER) != 0) + res = "number"; break; case Node_var_new: res = "untyped"; -- cgit v1.2.3 From 687e6594ca3a6195ef834a5466b5fc7de2de2d7b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 28 Jun 2015 22:08:12 +0300 Subject: Improve memory tracking on typed regex. --- builtin.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'builtin.c') diff --git a/builtin.c b/builtin.c index 6ad4de36..c28cd0a8 100644 --- a/builtin.c +++ b/builtin.c @@ -3884,9 +3884,7 @@ do_typeof(int nargs) deref = false; break; case Node_typedregex: - /* Op_push_re does not UPREF */ res = "regexp"; - deref = false; break; case Node_val: case Node_var: -- cgit v1.2.3