GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
JE::LValue(3) User Contributed Perl Documentation JE::LValue(3)

JE::LValue - JavaScript lvalue class

  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

This class implements JavaScript lvalues (called "Reference Types" by the ECMAScript specification).

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::can" on 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 "!$lvalue" is the same as calling "!$lvalue->get".

$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 "->get" is 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.)
$lv->get
Gets the value of the property.
$lv->set($value)
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.)
$lv->call(@args)
If the property is a function, this calls the function with the base object as the 'this' value.
$lv->base
Returns the base object. If there isn't any, it returns undef or an empty list, depending on context.
$lv->property
Returns the property name.
2014-10-20 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.