JS

Summary

Declares all JavaScript (ECMAScript 3) symbols as external.

Description

Declares all JavaScript (ECMAScript 3) symbols as external.

Examples

Basic Usage
1
2
3
4
5
import Externals.JS;
 
// JS++ uses classes and not prototypes so 'Object.prototype' is unavailable
// unless you import 'Externals.JS'
Object.prototype.hasOwnProperty.call({}, "foo");
Using JavaScript and JS++ at the same time
1
2
3
4
5
6
7
8
9
10
11
import System;
import Externals.JS;
 
// If both 'System' and 'Externals.JS' are imported, you *must* qualify the
// names with either 'System' or 'Externals.JS'/'JS'
 
System.Object obj1 = new System.Object(); // JS++ 'Object'
Console.log(obj1.toString());
 
var obj2 = new Externals.JS.Object(); // JavaScript 'Object'
Console.log(obj2.toString());

Share

HTML | BBCode | Direct Link