info[0] is a flag to determine if the weak, persistent, or multiple reference ObjectReference is being requested.
| 339 | // info[0] is a flag to determine if the weak, persistent, or |
| 340 | // multiple reference ObjectReference is being requested. |
| 341 | Value GetCastedFromValue(const CallbackInfo& info) { |
| 342 | Env env = info.Env(); |
| 343 | |
| 344 | if (info[0] == String::New(env, "weak")) { |
| 345 | if (casted_weak.IsEmpty()) { |
| 346 | return String::New(env, "No Referenced Value"); |
| 347 | } else { |
| 348 | return casted_weak.Value(); |
| 349 | } |
| 350 | } else if (info[0] == String::New(env, "persistent")) { |
| 351 | return casted_persistent.Value(); |
| 352 | } else { |
| 353 | return casted_reference.Value(); |
| 354 | } |
| 355 | } |
| 356 | |
| 357 | // info[0] is a flag to determine if the weak, persistent, or |
| 358 | // multiple reference ObjectReference is being requested. |