Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///@desc Accesses a map .
- ///@param map
- ///@param keys...
- var ds = argument[0];
- var key = undefined;
- var val = undefined;
- for (var i=1;i<argument_count;i++) {
- key = argument[i];
- val = ds[? key];
- if (is_undefined(val)) {
- // we failed to find a nested value
- // just return it now
- return undefined;
- }
- if (i < argument_count-1) {
- if ds_exists(val, ds_type_map) {
- // we're not at the last argument, so change the map target
- // AND
- // a map exists at the value we requested
- ds = val;
- }
- }
- }
- return val;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement