27 Oct 2014 00:19:07 UTC
- Distribution: JE
- Module version: 0.066
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (3)
- Testers (3117 / 30 / 37)
- KwaliteeBus factor: 0
- 90.35% Coverage
- License: unknown
- Activity24 month
- Download (274.99KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:13 non-PAUSE usersSPROUT Father Chrysostomosand 1 contributors
- Father Chrysostomos
use JE::LValue; $lv = new JE::LValue $some_obj, 'property_name'; $lv->get; # get property $lv->set($value) # set property $lv->some_other_method # same as $lv->get->some_other_method
If a method is called that is not listed here, it will be passed to the property referenced by the lvalue. (See the last item in the SYNOPSIS, above.) For this reason, you should never call
UNIVERSAL::canon a JE::LValue, but, rather, call it as a method (
$lv->can(...)), unless you really know what you are doing.
Similarly, if you try to use an overloaded operator, it will be passed on to the object that the lvalue references, such that
!$lvalueis the same as calling
- $lv = new JE::LValue $obj, $property
Creates an lvalue/reference with $obj as the base object and $property as the property name. If $obj is undefined or null, a TypeError is thrown. To create a lvalue that has no base object, and which will throw a ReferenceError when
->getis called and create a global property upon invocation of
->set, pass an unblessed reference to a global object as the first argument. (This is used by bare identifiers in JS expressions.)
Gets the value of the property.
Sets the property to $value and returns $value. If the lvalue has no base object, the global object will become its base object automatically. <Note:> Whether the lvalue object itself is modified in the latter case is not set in stone yet. (Currently it is modified, but that may change.)
If the property is a function, this calls the function with the base object as the 'this' value.
Returns the base object. If there isn't any, it returns undef or an empty list, depending on context.
Returns the property name.