JScript Language Reference¶
Important
Starting from Rapise 8.0, the default JavaScript engine used is NodeJS v14.15.3 runtime. Starting from Rapise 8.1, the default JavaScript engine used is NodeJS v18.18.0 runtime.
In versions prior to 6.7, Rapise used Microsoft JScript with WScript as the only available JavaScript engine. This document provides a language reference for that older version.
If you have existing tests or testing frameworks that are not compatible with NodeJS, you have the option to switch back to using WScript.
You can set the desired engine in two locations:
-
In the Test Settings (choose from Default, Node, WScript). The Default option uses the engine defined in the Global Options.
-
In the Global Options (choose from Default, Node, WScript). The Default option means Node.
NodeJS Support Features and Limitations¶
Features¶
- NodeJS v14 contains most of latest features of JavaScript including EcmaScript2015 (ES6) and beyond. You may see more detailed list of features here.
- You may find the most complete and up to date language reference at https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference.
- You may use most of available npm packages in your test scripts. You may include
node_modules
folders in the root of your testing framework (i.e.%WORKDIR%\node_modules
).
Limitations¶
-
NodeJS engine now runs in 32 bit mode. This is required to keep compatibility with
ActiveXObject
support that is an essential part of WScript but has to be emulated in NodeJS. -
Rapise has own copy of node.exe installed. So if you have npm modules installed globally and need to use them in your test, you have to install them locally into the framework.
Reference¶
The language reference covers EcmaScript v2 supported by default JScript Engine. It is missing majority of latest features, properties and methods. For example, there is no Array.join
or String.trim
.
- GetObject Function
- ScriptEngine Function
- ScriptEngineBuildVersion Function
- ScriptEngineMajorVersion Function
- ScriptEngineMinorVersion Function
Methods A-C¶
- abs Method
- acos Method
- anchor Method
- apply Method
- asin Method
- atan Method
- atan2 Method
- atEnd Method
- big Method
- blink Method
- bold Method
- call Method
- ceil Method
- charAt Method
- charCodeAt Method
- compile Method
- concat Method (Array)
- concat Method (String)
- cos Method
Methods D-F¶
- decodeURI Method
- decodeURIComponent Method
- dimensions Method
- encodeURI Method
- encodeURIComponent Method
- escape Method
- eval Method
- exec Method
- exp Method
- fixed Method
- floor Method
- fontcolor Method
- fontsize Method
- fromCharCode Method
Methods G¶
- getDate Method
- getDay Method
- getFullYear Method
- getHours Method
- getItem Method
- getMilliseconds Method
- getMinutes Method
- getMonth Method
- getSeconds Method
- getTime Method
- getTimezoneOffset Method
- getUTCDate Method
- getUTCDay Method
- getUTCFullYear Method
- getUTCHours Method
- getUTCMilliseconds Method
- getUTCMinutes Method
- getUTCMonth Method
- getUTCSeconds Method
- getVarDate Method
- getYear Method
Methods I-M¶
- indexOf Method
- isFinite Method
- isNaN Method
- italics Method
- item Method
- join Method
- lastIndexOf Method
- lbound Method
- link Method
- localeCompare Method
- log Method
- match Method
- max Method
- min Method
- moveFirst Method
- moveNext Method
Methods P-R¶
- parse Method
- parseFloat Method
- parseInt Method
- pop Method
- pow Method
- push Method
- random Method
- replace Method
- reverse Method
- round Method
Methods S¶
- search Method
- setDate Method
- setFullYear Method
- setHours Method
- setMilliseconds Method
- setMinutes Method
- setMonth Method
- setSeconds Method
- setTime Method
- setUTCDate Method
- setUTCFullYear Method
- setUTCHours Method
- setUTCMilliseconds Method
- setUTCMinutes Method
- setUTCMonth Method
- setUTCSeconds Method
- setYear Method
- shift Method
- sin Method
- slice Method (Array)
- slice Method (String)
- small Method
- sort Method
- splice Method
- split Method
- sqrt Method
- strike Method
- sub Method
- substr Method
- substring Method
- sup Method
Methods T-V¶
- tan Method
- test Method
- toArray Method
- toDateString Method
- toExponential Method
- toFixed Method
- toGMTString Method
- toLocaleDateString Method
- toLocaleLowerCase Method
- toLocaleString Method
- toLocaleTimeString Method
- toLocaleUpperCase Method
- toLowerCase Method
- toPrecision Method
- toString Method
- toTimeString Method
- toUpperCase Method
- toUTCString Method
- ubound Method
- unescape Method
- unshift Method
- UTC Method
- valueOf Method
Objects¶
- ActiveXObject Object
- Array Object
- arguments Object
- Boolean Object
- Date Object
- Enumerator Object
- Error Object
- Function Object
- Global Object
- Math Object
- Number Object
- Object Object
- RegExp Object
- Regular Expression Object
- String Object
- VBArray Object
Operators¶
- Addition Assignment Operator (+=)
- Addition Operator (+)
- Assignment Operator (=)
- Bitwise AND Assignment Operator (&=)
- Bitwise AND Operator (&)
- Bitwise Left Shift Operator (<<)
- Bitwise NOT Operator (~)
- Bitwise OR Assignment Operator (|=)
- Bitwise OR Operator (|)
- Bitwise Right Shift Operator (>>)
- Bitwise XOR Assignment Operator (^=)
- Bitwise XOR Operator (^)
- Comma Operator (,)
- Comparison Operators
- Compound Assignment Operators
- Conditional (Ternary) Operator (?:)
- delete Operator
- Division Assignment Operator (/=)
- Division Operator (/)
- in Operator
- Increment (++) and Decrement (--) Operators
- instanceof Operator
- Left Shift Assignment Operator (<<=)
- Logical AND Operator (&&)
- Logical NOT Operator (!)
- Logical OR Operator (||)
- Modulus Assignment Operator (%=)
- Modulus Operator (%)
- Multiplication Assignment Operator (*=)
- Multiplication Operator (*)
- new Operator
- Right Shift Assignment Operator (>>=)
- Subtraction Assignment Operator (-=)
- Subtraction Operator (-)
- typeof Operator
- Unsigned Right Shift Operator (>>>)
- Unsigned Right Shift Assignment Operator (>>>=)
- void Operator
Properties¶
- 0...n Properties
- $1...$9 Properties
- arguments Property
- callee Property
- caller Property
- constructor Property
- description Property
- E Property
- global Property
- hasOwnProperty Method
- ignoreCase Property
- index Property
- Infinity Property
- input Property ($_)
- isPrototypeOf Method
- lastIndex Property
- leftContext Property ($`)
- length Property (arguments)
- length Property (Array)
- lastMatch Property ($&)
- lastParen Property ($+)
- length Property (Function)
- length Property (String)
- LN10 Property
- LN2 Property
- LOG10E Property
- LOG2E Property
- MAX_VALUE Property
- message Property
- MIN_VALUE Property
- multiline Property
- name Property
- NaN Property
- NaN Property (Global)
- NEGATIVE_INFINITY Property
- number Property
- PI Property
- POSITIVE_INFINITY Property
- propertyIsEnumerable Property
- prototype Property
- rightContext Property ($')
- source Property
- SQRT1_2 Property
- SQRT2 Property
- undefined Property
Statements¶
- @cc_on Statement
- @if Statement
- @set Statement
- break Statement
- Comment Statements
- continue Statement
- do...while Statement
- for Statement
- for...in Statement
- function Statement
- if...else Statement
- Labeled Statement
- return Statement
- switch Statement
- this Statement
- throw Statement
- try...catch...finally Statement
- var Statement
- while Statement
- with Statement
JScript Fundamentals¶
- What Is JScript?
- Writing JScript Code
- JScript Variables
- JScript Data Types
- JScript Operators
- Operator Precedence
- Controlling Program Flow
- JScript Functions
- JScript Objects
- Creating Your Own Objects
- Intrinsic Objects
- JScript Reserved Words
Advanced JScript¶
- Advanced Object Creation
- Recursion
- Variable Scope
- Copying, Passing, and Comparing Data
- Using Arrays
- Special Characters
- Troubleshooting Your Scripts
- Conditional Compilation
- Conditional Compilation Variables
Introduction to Regular Expressions¶
- Regular Expressions
- Early Beginnings
- Uses for Regular Expressions
- Regular Expression Syntax
- Build a Regular Expression
- Order of Precedence
- Ordinary Characters
- Special Characters
- Non-Printable Characters
- Character Matching
- Quantifiers
- Anchors
- Alternation and Grouping
- Backreferences