[FIXED ]Is json.subset Broken?

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice, MapTool BugReport Manager

Post Reply
MafiaPUppet
Cave Troll
Posts: 33
Joined: Thu Aug 02, 2012 9:36 pm

[FIXED ]Is json.subset Broken?

Post by MafiaPUppet »

I can't seem to get json.subset() to work in any of the recent versions. It says, "Undefined function: json.subset."

You can test it with,


[h:ja1 = '[1,2,3]']
[h:ja2 = '[1,2]']
[r:jaCheck = json.subset(ja1,ja2)]

Returns,
Undefined function: json.subset

Though, this is fixable by just defining yourself with...

[ ja1 = arg( 0 ) ]
[ ja2 = arg( 1 ) ]

[cSubset = 1]
[foreach(s1,ja2),code:{
[cContains = json.contains(ja1,s1)]
[if(cContains && cSubset):cSubset = 1; cSubset = 0]
}]

[macro.return = cSubset]

User avatar
CoveredInFish
Demigod
Posts: 3104
Joined: Mon Jun 29, 2009 10:37 am
Location: Germany
Contact:

Re: Is json.subset Broken?

Post by CoveredInFish »

Confirmed. (Tried the posted code and wrote one myself. Didnt investigated much.)

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: Is json.subset Broken?

Post by Azhrei »

Moved to Bug Reports.

The problem is that the documentation had the wrong function name. It should have been Wiki: json.isSubset(). Sorry! It's been fixed.

Kinda funny that no one detected this until now though. ;)

Post Reply

Return to “Resolved”