Revision: 367
http://sourceforge.net/p/javascriptlint/code/367
Author: matthiasmiller
Date: 2016-12-29 21:46:51 +0000 (Thu, 29 Dec 2016)
Log Message:
-----------
Add test for the "ambiguous_numeric_prop" warning.
Added Paths:
-----------
trunk/tests/warnings/ambiguous_numeric_prop.js
Added: trunk/tests/warnings/ambiguous_numeric_prop.js
===================================================================
--- trunk/tests/warnings/ambiguous_numeric_prop.js (rev 0)
+++ trunk/tests/warnings/ambiguous_numeric_prop.js 2016-12-29 21:46:51 UTC (rev 367)
@@ -0,0 +1,15 @@
+function ambiguous_numeric_prop() {
+ var a = {
+ 1: '',
+ 2.0: '', /*warning:ambiguous_numeric_prop*/
+ 2.1: '',
+ 2.2: '',
+ 0x3: '' /*warning:ambiguous_numeric_prop*/
+ };
+
+ a[1] = '';
+ a[2.0] = ''; /*warning:ambiguous_numeric_prop*/
+ a[2.1] = '';
+ a[0x3] = ''; /*warning:ambiguous_numeric_prop*/
+}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|