KValueRef ScopeMethodDelegate::Call(const ValueList& args) { std::string key = args.at(0)->ToString(); KObjectRef obj = IsGlobalKey(key) ? global : scope; if (type == GET) { // not found, look inside scope return obj->Get(key.c_str()); } else { KValueRef result = args.at(1); obj->SetNS(key.c_str(),result); return Value::Undefined; } }