-
Notifications
You must be signed in to change notification settings - Fork 35
TurboScript Reference
Editing... 🚧
This part of the TurboScript section serves as a repository of facts about the TurboScript language. Read more about this reference. Most of this reference is redundant to JavaScript language reference. You may check difference between JavaScript and TurboScript for non-standard language features added in to TurboScript.
This chapter documents all the TurboScript standard built-in objects, along with their methods and properties.
Icon | Meaning |
---|---|
🍼 | Need improvement |
🚧 | Implementing |
🕥 | Planned |
💥 | Not all targets support |
❗️ | Bug in Implementation |
👎 | Not usable |
❌ | Removed |
Deprecated |
These global properties return a simple value; they have no properties or methods.
These global functions—functions which are called globally rather than on an object—directly return their results to the caller.
These are the fundamental, basic objects upon which all other objects are based. This includes objects that represent general objects, functions, and errors.
- Object 🕥
- Function
- boolean
- Error 🕥
- InternalError 🕥
- RangeError 🕥
- ReferenceError 🕥
- SyntaxError 🕥
- TypeError 🕥
These are the base objects representing numbers, dates, and mathematical calculations.
These objects represent strings and support manipulating them.
These objects represent collections of data which are ordered by an index value. This includes (typed) arrays and array-like constructs.
- Array 🚧
- Int8Array 🚧
- Uint8Array 🚧
- Uint8ClampedArray 🚧
- Int16Array 🚧
- Uint16Array 🚧
- Int32Array 🚧
- Uint32Array 🚧
- Float32Array 🚧
- Float64Array 🚧
These objects represent collections which use keys; these contain elements which are iterable in the order of insertion.
SIMD vector data types are objects where data is arranged into lanes.
- SIMD 🕥
- SIMD.Float32x4 🕥
- SIMD.Float64x2 🕥
- SIMD.Int8x16 🕥
- SIMD.Int16x8 🕥
- SIMD.Int32x4 🕥
- SIMD.Uint8x16 🕥
- SIMD.Uint16x8 🕥
- SIMD.Uint32x4 🕥
- SIMD.Bool8x16 🕥
- SIMD.Bool16x8 🕥
- SIMD.Bool32x4 🕥
- SIMD.Bool64x2 🕥
These objects represent and interact with structured data buffers and data coded using JavaScript Object Notation (JSON).
- ArrayBuffer 💥 🕥
- SharedArrayBuffer 💥 🕥
- Atomics 💥 🕥
- DataView 💥 🕥
- JSON 💥 🕥
This chapter documents all the TurboScript statements and declarations.
A block statement is used to group zero or more statements. The block is delimited by a pair of curly brackets.
Terminates the current loop, switch, or label statement and transfers program control to the statement following the terminated statement.
Terminates execution of the statements in the current iteration of the current or labeled loop, and continues execution of the loop with the next iteration.
An empty statement is used to provide no statement, although the TurboScript syntax would expect one.
Executes a statement if a specified condition is true. If the condition is false, another statement can be executed.
Evaluates an expression, matching the expression's value to a case clause, and executes statements associated with that case.
throw 💥 🕥
Throws a user-defined exception.
try...catch 💥 🕥
Marks a block of statements to try, and specifies a response, should an exception be thrown.
Declares a variable, optionally initializing it to a value.
Declares a block scope local variable, optionally initializing it to a value.
Declares a read-only named constant.
Declares a function with the specified parameters.
Specifies the value to be returned by a function.
Declares a class.
Creates a loop that consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement executed in the loop.
Creates a loop that executes a specified statement as long as the test condition evaluates to true. The condition is evaluated before executing the statement.
Invokes any available debugging functionality. If no debugging functionality is available, this statement has no effect.
Used to export functions to make them available for imports in external modules, another scripts.
Used to import functions exported from an external module, another script.
Provides a statement with an identifier that you can refer to using a break or continue statement.
This chapter documents all the TurboScript expressions and operators.
Basic keywords and general expressions in TurboScript.
The this keyword refers to the function's execution context.
The function keyword defines a function expression.
The class keyword defines a class expression.
Grouping operator.
Left values are the destination of an assignment.
Member operators provide access to a property or method of an object (object.property).
The new operator creates an instance of a constructor.
The super keyword calls the parent constructor.
Postfix/prefix increment and postfix/prefix decrement operators.
Postfix increment operator.
Postfix decrement operator.
Prefix increment operator.
Prefix decrement operator.
A unary operation is operation with only one operand.
The delete operator deletes a property from an object.
The void operator discards an expression's return value.
The typeof operator determines the type of a given object.
The unary plus operator converts its operand to Number type.
The unary negation operator converts its operand to Number type and then negates it.
Bitwise NOT operator.
Logical NOT operator.
Arithmetic operators take numerical values (either literals or variables) as their operands and return a single numerical value.
Addition operator.
Subtraction operator.
Division operator.
Multiplication operator.
Remainder operator.
A comparison operator compares its operands and returns a boolean value based on whether the comparison is true.
The instanceof operator determines whether an object is an instance of another object.
Less than operator.
Greater than operator.
Less than or equal operator.
Greater than or equal operator.
The result of evaluating an equality operator is always of type Boolean based on whether the comparison is true.
Equality operator.
Inequality operator.
Identity operator.
Nonidentity operator.
Operations to shift all bits of the operand.
Bitwise left shift operator.
Bitwise right shift operator.
Bitwise unsigned right shift operator.
Bitwise operators treat their operands as a set of 32 bits (zeros and ones) and return standard JavaScript numerical values.
Bitwise AND.
Bitwise OR.
Bitwise XOR.
Logical operators are typically used with boolean (logical) values, and when they are, they return a boolean value.
Logical AND.
Logical OR.
The conditional operator returns one of two values based on the logical value of the condition.
An assignment operator assigns a value to its left operand based on the value of its right operand.
Assignment operator.
Multiplication assignment.
Division assignment.
Remainder assignment.
Addition assignment.
Subtraction assignment
Left shift assignment.
Right shift assignment.
Unsigned right shift assignment.
Bitwise AND assignment.
Bitwise XOR assignment.
Bitwise OR assignment.