view release on metacpan or search on metacpan
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
view all matches for this distribution
view release on metacpan or search on metacpan
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
view all matches for this distribution
view release on metacpan or search on metacpan
dontenum => 1,
});
# E 15.1.1
$self->prop({
name => 'NaN',
value => JE::Number->new($self, 'NaN'),
dontenum => 1,
dontdel => 1,
});
$self->prop({
name => 'Infinity',
},
}),
dontenum => 1,
});
$self->prop({
name => 'isNaN',
value => JE::Object::Function->new({
scope => $self,
name => 'isNaN',
argnames => [qw/number/],
no_proto => 1,
function_args => ['args'],
function => sub {
JE::Boolean->new($self,
}
print $j->{x}, "\n";
=item *
NaN and Infinity do not work properly on some Windows compilers. 32-bit
ActivePerl seems not to work, but I have been told 64-bit is OK.
Strawberry Perl works fine, which is what most people are using.
=back
The C<setTime> method of a Date object does what one would expect (it sets
the number of milliseconds stored in the Date object and returns that
number).
According to the obfuscated definition in the ECMAScript specification, it
should always set it to NaN and return NaN.
I think I've found I<yet another> typo in the spec. In clause 15.9.5.27,
'Result(1)' and and 'Result(2)' are probably supposed to be 'Result(2)' and
'Result(3)', respectively.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JQuery/jquery_js/plugins/interface/interface.js view on Meta::CPAN
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
*
*/
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};wh...
view all matches for this distribution
view release on metacpan or search on metacpan
tests/lib/Test/Builder.js view on Meta::CPAN
}
};
Test.Builder.prototype.expectedTests = function (max) {
if (max) {
if (isNaN(max)) {
Test.Builder.die(
"Number of tests must be a postive integer. You gave it '"
+ max + "'." + Test.Builder.LF
);
}
view all matches for this distribution
view release on metacpan or search on metacpan
tests/lib/Test/Builder.js view on Meta::CPAN
}
};
Test.Builder.prototype.expectedTests = function (max) {
if (max) {
if (isNaN(max)) {
Test.Builder.die(
"Number of tests must be a postive integer. You gave it '"
+ max + "'." + Test.Builder.LF
);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JS/JSLint.js view on Meta::CPAN
html_handlers: string, i: object, id: string, identifier: boolean,
identifier_function: string, iframe: object, img: object, immed: boolean,
implied_evil: string, in, indent: number, indexOf: *, infix_in: string,
init: function, input: object, ins: object, insecure_a: string,
isAlpha: function, isArray: function boolean, isDigit: function,
isExtensible: string, isFrozen: string, isNaN: string,
isPrototypeOf: string, isSealed: string, join: *, jslint: function boolean,
json: boolean, kbd: object, keygen: object, keys: *, label: object,
label_a_b: string, labeled: boolean, lang: string, lastIndex: string,
lastIndexOf: *, lbp: number, leading_decimal_a: string, led: function,
left: array, legend: object, length: *, 'letter-spacing': array,
lib/JS/JSLint.js view on Meta::CPAN
"and instead saw a function invocation.",
implied_evil: "Implied eval is evil. Pass a function instead of a string.",
infix_in: "Unexpected 'in'. Compare with undefined, or use the " +
"hasOwnProperty method instead.",
insecure_a: "Insecure '{a}'.",
isNaN: "Use the isNaN function to compare with NaN.",
label_a_b: "Label '{a}' on '{b}' statement.",
lang: "lang is deprecated.",
leading_decimal_a: "A leading decimal point can be confused with a dot: '.{a}'.",
missing_a: "Missing '{a}'.",
missing_a_after_b: "Missing '{a}' after '{b}'.",
lib/JS/JSLint.js view on Meta::CPAN
// ECMAScript standard.
standard = array_to_object([
'Array', 'Boolean', 'Date', 'decodeURI', 'decodeURIComponent',
'encodeURI', 'encodeURIComponent', 'Error', 'eval', 'EvalError',
'Function', 'isFinite', 'isNaN', 'JSON', 'Math', 'Number', 'Object',
'parseInt', 'parseFloat', 'RangeError', 'ReferenceError', 'RegExp',
'String', 'SyntaxError', 'TypeError', 'URIError'
], false),
standard_property_type = {
lib/JS/JSLint.js view on Meta::CPAN
}
break;
case 'false':
case 'function':
case 'Infinity':
case 'NaN':
case 'null':
case 'true':
case 'undefined':
case 'void':
case '(number)':
lib/JS/JSLint.js view on Meta::CPAN
case 'function':
case 'regexp':
warn('unexpected_a', node);
break;
default:
if (node.id === 'NaN') {
warn('isnan', node);
}
}
return node;
}
lib/JS/JSLint.js view on Meta::CPAN
warn('adsafe_a', x);
}
});
constant('false', 'boolean');
constant('Infinity', 'number');
constant('NaN', 'number');
constant('null', '');
reservevar('this', function (x) {
if (option.safe) {
warn('adsafe_a', x);
} else if (strict_mode && funct['(token)'].arity === 'statement' &&
lib/JS/JSLint.js view on Meta::CPAN
one_space();
particular = expression(0);
cases.forEach(find_duplicate_case);
cases.push(particular);
the_case.first.push(particular);
if (particular.id === 'NaN') {
warn('unexpected_a', particular);
}
no_space_only();
advance(':');
if (next_token.id !== 'case') {
view all matches for this distribution
view release on metacpan or search on metacpan
tests/lib/Test/Builder.js view on Meta::CPAN
}
};
Test.Builder.prototype.expectedTests = function (max) {
if (max) {
if (isNaN(max)) {
Test.Builder.die(
"Number of tests must be a postive integer. You gave it '"
+ max + "'." + Test.Builder.LF
);
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/fixtures/jquery.js view on Meta::CPAN
isWindow: function( obj ) {
return obj != null && obj == obj.window;
},
isNumeric: function( obj ) {
return !isNaN( parseFloat(obj) ) && isFinite( obj );
},
type: function( obj ) {
if ( obj == null ) {
return String( obj );
t/fixtures/jquery.js view on Meta::CPAN
// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
funescape = function( _, escaped ) {
var high = "0x" + escaped - 0x10000;
// NaN means non-codepoint
return high !== high ?
escaped :
// BMP codepoint
high < 0 ?
String.fromCharCode( high + 0x10000 ) :
t/fixtures/jquery.js view on Meta::CPAN
value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
// Fixes bug #9237
type = "number";
}
// Make sure that NaN and null values aren't set. See: #7116
if ( value == null || type === "number" && isNaN( value ) ) {
return;
}
// If a number was passed in, add 'px' to the (except for certain CSS properties)
if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
t/fixtures/jquery.js view on Meta::CPAN
// Adjust and apply
start = start / scale;
jQuery.style( tween.elem, prop, start + unit );
// Update scale, tolerating zero or NaN from tween.cur()
// And breaking the loop if scale is unchanged or perfect, or if we've just had enough
} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
}
tween.unit = unit;
view all matches for this distribution
view release on metacpan or search on metacpan
tests/lib/Test/Builder.js view on Meta::CPAN
}
};
Test.Builder.prototype.expectedTests = function (max) {
if (max) {
if (isNaN(max)) {
Test.Builder.die(
"Number of tests must be a postive integer. You gave it '"
+ max + "'." + Test.Builder.LF
);
}
view all matches for this distribution
view release on metacpan or search on metacpan
proper encoding for the "script" elements it creates.
- Added support for Opera, with thanks to Pawel Chmielowski.
- Fixed the output from skipAll in the test harness.
- Fixed display of summary of failed tests after all tests have been run
by the browser harness. They are now displayed in a nicely formatted
table without a "NaN" stuck where it doesn't belong.
- COMPATIBILITY CHANGE: The browser harness now outputs failure
information bold-faced and red. This required changing the "output"
argument to the outputResults() method to an object with two methods,
pass() and fail(). Anyone using Test.Harness.outputResults() will want
to make any changes accordingly.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JS/jQuery.js view on Meta::CPAN
// Force it by setting the zoom level
elem.zoom = 1;
// Set the alpha filter to set the opacity
elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
(parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
}
return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
"";
view all matches for this distribution
view release on metacpan or search on metacpan
0.18 2015-12-30
* Better documentation of Unicode handling.
* Add "downgrade_utf8" method (experimental).
0.17 2015-12-29
* Add handlers for NaN and infinity.
* Documented how to remove values set by obj_handler or type_handler.
0.16 2015-12-26
* Change required version of JSON::Parse to 0.38.
0.06 2015-10-27
* More tests and benchmarks for floating point
* Fixes bug with ASCII control characters
0.05 2015-10-26
* Handling of NaN, negative and positive infinity via
stringification.
* Removed dereferencing behaviour for objects.
* Documentation clarifies some behaviours and performance.
* Further performance wrangling for integers.
view all matches for this distribution
view release on metacpan or search on metacpan
external/rapidjson/reader.h view on Meta::CPAN
kParseStopWhenDoneFlag = 8, //!< After parsing a complete JSON root from stream, stop further processing the rest of stream. When this flag is used, parser will not generate kParseErrorDocumentRootNotSingular error.
kParseFullPrecisionFlag = 16, //!< Parse number in full precision (but slower).
kParseCommentsFlag = 32, //!< Allow one-line (//) and multi-line (/**/) comments.
kParseNumbersAsStringsFlag = 64, //!< Parse all numbers (ints/doubles) as strings.
kParseTrailingCommasFlag = 128, //!< Allow trailing commas at the end of objects and arrays.
kParseNanAndInfFlag = 256, //!< Allow parsing NaN, Inf, Infinity, -Inf and -Infinity as doubles.
kParseDefaultFlags = RAPIDJSON_PARSE_DEFAULT_FLAGS //!< Default parse flags. Can be customized by defining RAPIDJSON_PARSE_DEFAULT_FLAGS
};
///////////////////////////////////////////////////////////////////////////////
// Handler
external/rapidjson/reader.h view on Meta::CPAN
}
i = i * 10 + static_cast<unsigned>(s.TakePush() - '0');
significandDigit++;
}
}
// Parse NaN or Infinity here
else if ((parseFlags & kParseNanAndInfFlag) && RAPIDJSON_LIKELY((s.Peek() == 'I' || s.Peek() == 'N'))) {
if (Consume(s, 'N')) {
if (Consume(s, 'a') && Consume(s, 'N')) {
d = std::numeric_limits<double>::quiet_NaN();
useNanOrInf = true;
}
}
else if (RAPIDJSON_LIKELY(Consume(s, 'I'))) {
if (Consume(s, 'n') && Consume(s, 'f')) {
view all matches for this distribution
view release on metacpan or search on metacpan
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JSON/PP.pm view on Meta::CPAN
Note that numerical precision has the same meaning as under Perl (so
binary to decimal conversion follows the same rules as in Perl, which
can differ to other languages). Also, your perl interpreter might expose
extensions to the floating point numbers of your platform, such as
infinities or NaN's - these cannot be represented in JSON, and it is an
error to pass those in.
JSON::PP (and JSON::XS) trusts what you pass to C<encode> method
(or C<encode_json> function) is a clean, validated data structure with
values that can be represented as valid JSON values only, because it's
not from an external data source (as opposed to JSON texts you pass to
C<decode> or C<decode_json>, which JSON::PP considers tainted and
doesn't trust). As JSON::PP doesn't know exactly what you and consumers
of your JSON texts want the unexpected values to be (you may want to
convert them into null, or to stringify them with or without
normalisation (string representation of infinities/NaN may vary
depending on platforms), or to croak without conversion), you're advised
to do what you and your consumers need before you encode, and also not
to numify values that may start with values that look like a number
(including infinities/NaN), without validating.
=back
=head2 OBJECT SERIALISATION
view all matches for this distribution
view release on metacpan or search on metacpan
Note that numerical precision has the same meaning as under Perl (so
binary to decimal conversion follows the same rules as in Perl, which
can differ to other languages). Also, your perl interpreter might expose
extensions to the floating point numbers of your platform, such as
infinities or NaN's - these cannot be represented in JSON, and it is an
error to pass those in.
=back
=head2 OBJECT SERIALISATION
view all matches for this distribution
view release on metacpan or search on metacpan
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
view all matches for this distribution
view release on metacpan or search on metacpan
t/formats.t view on Meta::CPAN
# a signed 64-bit integer; see https://spec.openapis.org/api/format.json
int64 => +{ type => ['number', 'string'], sub => sub ($value) {
my $type = get_type($value);
return if not grep $type eq $_, qw(integer number string);
$value = Math::BigInt->new($value) if $type eq 'string';
return if $value eq 'NaN';
# using the literal numbers rather than -2**63, 2**63 -1 to maintain precision
$value >= Math::BigInt->new('-9223372036854775808') && $value <= Math::BigInt->new('9223372036854775807');
} },
},
);
t/formats.t view on Meta::CPAN
'"0"',
'"9223372036854775806"', # within bounds
'"9223372036854775807"', # maximum value
'"9223372036854775808"', # out of bounds
'"Inf"',
'"NaN"',
# number
'-9223372036854775809', # 13: out of bounds
'-9223372036854775808', # minimum value; difficult to use on most architectures without Math::BigInt
'-9223372036854775807', # within bounds
'0',
'9223372036854775806', # within bounds
'9223372036854775807', # maximum value
'9223372036854775808', # 19: out of bounds
# numeric Inf and NaN are not valid JSON
);
# note: results may vary on 32-bit architectures when not using Math::BigFloat
foreach my $decoder (
JSON::Schema::Modern::_JSON_BACKEND()->new->allow_nonref(1)->utf8(0),
view all matches for this distribution
view release on metacpan or search on metacpan
share/tv4.min.js view on Meta::CPAN
!function(a,b){"function"==typeof define&&define.amd?define([],b):"undefined"!=typeof module&&module.exports?module.exports=b():a.tv4=b()}(this,function(){function a(a){return encodeURI(a).replace(/%25[0-9][0-9]/g,function(a){return"%"+a.substring(3)...
view all matches for this distribution
view release on metacpan or search on metacpan
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
view all matches for this distribution
view release on metacpan or search on metacpan
Note that numerical precision has the same meaning as under Perl (so
binary to decimal conversion follows the same rules as in Perl, which
can differ to other languages). Also, your perl interpreter might expose
extensions to the floating point numbers of your platform, such as
infinities or NaN's - these cannot be represented in JSON, and it is an
error to pass those in.
=back
=head2 OBJECT SERIALISATION
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JSON/YAJL/ppport.h view on Meta::CPAN
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JSON.pm view on Meta::CPAN
Note that numerical precision has the same meaning as under Perl (so
binary to decimal conversion follows the same rules as in Perl, which
can differ to other languages). Also, your perl interpreter might expose
extensions to the floating point numbers of your platform, such as
infinities or NaN's - these cannot be represented in JSON, and it is an
error to pass those in.
JSON.pm backend modules trust what you pass to C<encode> method
(or C<encode_json> function) is a clean, validated data structure with
values that can be represented as valid JSON values only, because it's
not from an external data source (as opposed to JSON texts you pass to
C<decode> or C<decode_json>, which JSON backends consider tainted and
don't trust). As JSON backends don't know exactly what you and consumers
of your JSON texts want the unexpected values to be (you may want to
convert them into null, or to stringify them with or without
normalisation (string representation of infinities/NaN may vary
depending on platforms), or to croak without conversion), you're advised
to do what you and your consumers need before you encode, and also not
to numify values that may start with values that look like a number
(including infinities/NaN), without validating.
=back
=head2 OBJECT SERIALISATION
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JSON5.pm view on Meta::CPAN
$perl_scalar = $json5->decode($json5_text)
JSON5 numbers and strings become simple Perl scalars. JSON5 arrays become
Perl arrayrefs and JSON5 objects become Perl hashrefs. C<true> becomes
C<1> (C<JSON::PP::true>), C<false> becomes C<0> (C<JSON::PP::false>),
C<NaN> becomes C<'NaN'>, C<Infinity> becomes C<'Inf'>, and
C<null> becomes C<undef>.
=head1 SEE ALSO
L<JSON::PP>
view all matches for this distribution
view release on metacpan or search on metacpan
example/js/jquery-1.2.6.js view on Meta::CPAN
// Force it by setting the zoom level
elem.zoom = 1;
// Set the alpha filter to set the opacity
elem.filter = (elem.filter || "").replace( /alpha\([^)]*\)/, "" ) +
(parseInt( value ) + '' == "NaN" ? "" : "alpha(opacity=" + value * 100 + ")");
}
return elem.filter && elem.filter.indexOf("opacity=") >= 0 ?
(parseFloat( elem.filter.match(/opacity=([^)]*)/)[1] ) / 100) + '':
"";
view all matches for this distribution
view release on metacpan or search on metacpan
eg/jslib/jquery-1.3.2.min.js view on Meta::CPAN
* http://docs.jquery.com/License
*
* Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
* Revision: 6246
*/
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;thi...
/*
* Sizzle CSS Selector Engine - v0.9.3
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Jasonify.pm view on Meta::CPAN
__PACKAGE__->set(
# Numify options
infinite => 'Infinity',
-infinite => '-Infinity',
nonnumber => 'NaN',
#num_sep => undef,
);
lib/Jasonify.pm view on Meta::CPAN
);
# key string sortby
# ======= ============== ===========
# "inf", '"Infinity"', "Infinity"
# "-inf", '"-Infinity"', "-Infinity"
# "nan", '"NaN"', "NaN"
return Jasonify::_key->new( $_, @$rep );
}
sub _objectify_via {
my $self = shift;
lib/Jasonify.pm view on Meta::CPAN
=item I<infinite> => B<Infinifty>,
=item I<-infinite> => B<-Infinifty>,
=item I<nonnumber> => B<NaN>,
How to encode the values for infinity, negative infinity, and not-a-number.
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JavaScript/Duktape/C/lib/duk_config.h view on Meta::CPAN
#define DUK_DOUBLE_NAN NAN
#elif !defined(DUK_F_VBCC) && !defined(DUK_F_MSVC) && !defined(DUK_F_BCC) && \
!defined(DUK_F_OLD_SOLARIS) && !defined(DUK_F_AIX)
#define DUK_DOUBLE_NAN (0.0 / 0.0)
#else
/* In VBCC (0.0 / 0.0) results in a warning and 0.0 instead of NaN.
* In MSVC (VS2010 Express) (0.0 / 0.0) results in a compile error.
* Use a computed NaN (initialized when a heap is created at the
* latest).
*/
#define DUK_USE_COMPUTED_NAN
#define DUK_DOUBLE_NAN duk_computed_nan
#endif
lib/JavaScript/Duktape/C/lib/duk_config.h view on Meta::CPAN
* http://llvm.org/bugs/show_bug.cgi?id=17788
*/
#define DUK_F_USE_REPL_ALL
#elif defined(DUK_F_UCLIBC)
/* At least some uclibc versions have broken floating point math. For
* example, fpclassify() can incorrectly classify certain NaN formats.
* To be safe, use replacements.
*/
#define DUK_F_USE_REPL_ALL
#elif defined(DUK_F_AIX)
/* Older versions may be missing isnan(), etc. */
lib/JavaScript/Duktape/C/lib/duk_config.h view on Meta::CPAN
#undef DUK_USE_ATAN2_WORKAROUNDS
#if defined(DUK_F_MINGW)
#define DUK_USE_ATAN2_WORKAROUNDS
#endif
/* Rely as little as possible on compiler behavior for NaN comparison,
* signed zero handling, etc. Currently never activated but may be needed
* for broken compilers.
*/
#undef DUK_USE_PARANOID_MATH
view all matches for this distribution