Client-Side Slice-to-JavaScript Mapping
In this section, we present the client-side Slice-to-JavaScript mapping. The client-side Slice-to-JavaScript mapping defines how Slice data types are translated to JavaScript types, and how clients invoke operations, pass parameters, and handle errors. Much of the JavaScript mapping is intuitive. For example, Slice sequences map to JavaScript arrays, so there is essentially nothing new you have to learn in order to use Slice sequences in JavaScript.
Much of what appears in this chapter is reference material. We suggest that you skim the material on the initial reading and refer back to specific sections as needed. However, we recommend that you read at least the mappings for exceptions, interfaces, and operations in detail because these sections cover how to call operations from a client, pass parameters, and handle exceptions.
The Ice
Scope
All of the APIs for the Ice run time are nested in the Ice
scope, to avoid clashes with definitions for other libraries or applications. Some of the contents of the Ice
scope are generated from Slice definitions; other parts of the Ice
scope provide special-purpose definitions that do not have a corresponding Slice definition. We will incrementally cover the contents of the Ice
scope throughout the remainder of the manual.
Topics
- JavaScript Mapping for Identifiers
- JavaScript Mapping for Modules
- JavaScript Mapping for Built-In Types
- JavaScript Mapping for Enumerations
- JavaScript Mapping for Constants
- JavaScript Mapping for Structures
- JavaScript Mapping for Classes
- JavaScript Mapping for Sequences
- JavaScript Mapping for Dictionaries
- JavaScript Mapping for Exceptions
- JavaScript Mapping for Interfaces
- JavaScript Mapping for Operations
- slice2js Command-Line Options
- Example of a File System Client in JavaScript