From 446af60cc198b4fd7370a701c24b59a8b9274ec8 Mon Sep 17 00:00:00 2001 From: Tobias Boege Date: Mon, 11 Apr 2016 17:04:36 +0000 Subject: [PATCH] [GB.UTIL.WEB] * NEW: Always initialise JSON.Null, so that an entry in a JSONCollection with value JSON.Null appears in the Encode() string. git-svn-id: svn://localhost/gambas/trunk@7737 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.util.web/.info | 4 ++++ comp/src/gb.util.web/.src/JSON.module | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/comp/src/gb.util.web/.info b/comp/src/gb.util.web/.info index 31400b653..aa5bfab21 100644 --- a/comp/src/gb.util.web/.info +++ b/comp/src/gb.util.web/.info @@ -12,6 +12,10 @@ Null R v +_init +M + + Decode M v diff --git a/comp/src/gb.util.web/.src/JSON.module b/comp/src/gb.util.web/.src/JSON.module index 870fd4706..3cc223179 100644 --- a/comp/src/gb.util.web/.src/JSON.module +++ b/comp/src/gb.util.web/.src/JSON.module @@ -9,6 +9,12 @@ Private $sStr As String Private $iPos As Integer Private $bUseNull As Boolean +Public Sub _init() + + $vNull = VarPtr($vNull) + +End + Private Sub GetChar() As String Dim sCar As String @@ -260,7 +266,6 @@ Public Sub Decode(JSONString As String, Optional UseNull As Boolean) As Variant $sStr = JSONString $iPos = 1 $bUseNull = UseNull - If UseNull And If IsNull($vNull) Then $vNull = VarPtr($vNull) vVal = ReadValue() $bUseNull = False $sStr = ""