Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

je::number(3pm) [debian man page]

JE::Number(3pm) 					User Contributed Perl Documentation					   JE::Number(3pm)

NAME
JE::Number - JavaScript number value SYNOPSIS
use JE; use JE::Number; $j = JE->new; $js_num = new JE::Number $j, 17; $perl_num = $js_num->value; $js_num->to_object; # returns a new JE::Object::Number DESCRIPTION
This class implements JavaScript number values for JE. The difference between this and JE::Object::Number is that that module implements number objects, while this module implements the primitive values. Right now, this module simply uses Perl numbers underneath for storing the JavaScript numbers. It seems that whether Perl numbers are in accord with the IEEE 754 standard that ECMAScript uses is system-dependent. If anyone requires IEEE 754 compliancy, a patch would be welcome. :-) The "new" method accepts a global (JE) object and a number as its two arguments. If the latter is an object with a "to_number" method whose return value isa JE::Number, that object's internal value will be used. Otherwise the arg itself is used. (The precise details of the behaviour of "new" when the second arg is a object are subject to change.) It is numified Perl-style, so 'nancy' becomes NaN and 'information' becomes Infinity. The "value" method produces a Perl scalar. The "0+" numeric operator is overloaded and produces the same. Stringification and boolification are overloaded and produce the same results as in JavaScript The "typeof" and "class" methods produce the strings 'number' and 'Number', respectively. SEE ALSO
JE JE::Types JE::Object::Number perl v5.14.2 2012-03-18 JE::Number(3pm)

Check Out this Related Man Page

JE::Object::RegExp(3pm) 				User Contributed Perl Documentation				   JE::Object::RegExp(3pm)

NAME
JE::Object::RegExp - JavaScript regular expression (RegExp object) class SYNOPSIS
use JE; use JE::Object::RegExp; $j = new JE; $js_regexp = new JE::Object::RegExp $j, "(.*)", 'ims'; $perl_qr = $js_regexp->value; $some_string =~ $js_regexp; # You can use it as a qr// DESCRIPTION
This class implements JavaScript regular expressions for JE. See JE::Types for a description of most of the interface. Only what is specific to JE::Object::RegExp is explained here. A RegExp object will stringify the same way as a "qr//", so that you can use "=~" on it. This is different from the return value of the "to_string" method (the way it stringifies in JS). Since JE's regular expressions use Perl's engine underneath, the features that Perl provides that are not part of the ECMAScript spec are supported, except for "(?s)" and "(?m)", which don't do anything, and "(?|...)", which is unpredictable. In versions prior to 0.042, a hyphen adjacent to "d", "s" or "w" in a character class would be unpredictable (sometimes a syntax error). Now it is interpreted literally. This matches what most implementations do, which happens to be the same as Perl's behaviour. (It is a syntax error in ECMAScript.) METHODS
value Returns a Perl "qr//" regular expression. If the regular expression or the string that is being matched against it contains characters outside the Basic Multilingual Plane (whose character codes exceed 0xffff), the behavior is undefined--for now at least. I still need to solve the problem caused by JS's unintuitive use of raw surrogates. (In JS, "/../" will match a surrogate pair, which is considered to be one character in Perl. This means that the same regexp matched against the same string will produce different results in Perl and JS.) class Returns the string 'RegExp'. SEE ALSO
JE JE::Types JE::Object perl v5.14.2 2012-03-18 JE::Object::RegExp(3pm)
Man Page