| JScript | |
|---|---|
| Paradigms | Multi-paradigm:object-oriented (prototype-based),functional,imperative,scripting |
| Family | ECMAScript |
| Developer | Microsoft |
| First appeared | 1996; 30 years ago (1996) |
| Final release | 9.0 / March 2011; 14 years ago (2011-03) |
| Typing discipline | dynamic,weak,duck |
| Scope | lexical |
| OS | Microsoft Windows |
| License | proprietary |
| Filename extensions | .js,.jse,.wsf,.wsc (.htm,.html,.hta,.asp)[1] |
| Website | learn |
| Majorimplementations | |
| Active Scripting,JScript .NET | |
| Influenced by | |
| JavaScript | |
JScript is Microsoft'slegacy[2] dialect of theECMAScript standard[3] that is used inMicrosoft'sInternet Explorer web browser andHTML Applications, and as a standalone Windows scripting language. It isproprietary software.
JScript is implemented as anActive Scripting engine. This means that it can be "plugged in" toOLE Automation applications that support Active Scripting, such asInternet Explorer,Active Server Pages, andWindows Script Host.[4] It also means such applications can use multiple Active Scripting languages, e.g., JScript,VBScript orPerlScript.
JScript was first supported in theInternet Explorer 3.0 browser released in August 1996. Its most recent version is JScript 9.0, included in Internet Explorer 9.
JScript 10.0[5] is a separate dialect, also known asJScript .NET, which adds several new features from the abandoned fourth edition of the ECMAScript standard. It must be compiled for.NET Framework version 2 or version 4, but static type annotations are optional.
JScript has been criticized for being insecure and having multiple security bugs "exploited by nation-state actors",[6] leading Microsoft to add an option to disable it.[7]
As explained byDouglas Crockford in his talk titledThe JavaScript Programming Language on YUI Theater,
[Microsoft] did not want to deal withSun Microsystems about the trademark issue, and so they called their implementation JScript. A lot of people think that JScript and JavaScript are different but similar languages. That's not the case. They are just different names for the same language, and the reason the names are different was to get around trademark issues.[8]
However, JScript supports conditional compilation, which allows a programmer to selectively execute code withinblock comments. This is an extension to theECMAScript standard that is unsupported in other JavaScript implementations, thus making the above statement not fully true, although conditional compilation is no longer supported in Internet Explorer 11 Standards mode.
Other internal implementation differences between JavaScript and JScript, at some point in time, are noted on theMicrosoft Developer Network (MSDN).[9] The default type value for the script element in Internet Explorer is JavaScript, while JScript was its alias.[10] In an apparent transition from JScript to JavaScript, online, the Microsoft Edge [Legacy] Developer Guide refers to the Mozilla MDN web reference library as its definitive documentation.[11] As of October 2017, Microsoft MSDN pages for scripting in Internet Explorer are being redirected there as well.[12] This information may not include JScript specific objects, such as Enumerator, which are listed in the JavaScript language reference on Microsoft Docs.[13] Those provide additional features that are not included in the ECMA Standards, whether they are supported in theEdge [Legacy] browser or its predecessor.[14]
The original JScript is anActive Scripting engine. Like other Active Scripting languages, it is built on theCOM/OLE Automation platform and provides scripting capabilities to host applications.
This is the version used when hosting JScript inside a Web page displayed byInternet Explorer, in anHTML application beforeIE9, as well as inclassic ASP,Windows Script Host scripts and otherAutomation environments.
JScript is sometimes referred to as "classic JScript" or "Active Scripting JScript" to differentiate it from newer.NET-based versions.
Some versions of JScript are available for multiple versions of Internet Explorer and Windows. For example, JScript 5.7 was introduced withInternet Explorer 7.0 and is also installed forInternet Explorer 6.0 withWindows XPService Pack 3, while JScript 5.8 was introduced withInternet Explorer 8.0 and is also installed with Internet Explorer 6.0 onWindows Mobile 6.5.
Microsoft's implementation of ECMAScript 5th Edition inWindows 8 Consumer Preview is calledJavaScript and the correspondingVisual Studio 11 Express Beta includes a "completely new", full-featured JavaScript editor withIntelliSense enhancements forHTML5 andECMAScript 5 syntax, "VSDOC" annotations for multiple overloads, simplifiedDOM configuration, brace matching, collapsible outlining and "go to definition".[15]
| Version | Date | Introduced with[16] | Based on[note 1] | SimilarJavaScript version |
|---|---|---|---|---|
| 1.0 | Aug 1996 | Internet Explorer 3.0 | Netscape JavaScript | 1.0 |
| 2.0 | Jan 1997 | Windows IIS 3.0 | Netscape JavaScript | 1.1 |
| 3.0 | Oct 1997 | Internet Explorer 4.0 | ECMA-262 1st edition[note 2] | 1.3 |
| 4.0 | Visual Studio 6.0 (as part ofVisual InterDev) | ECMA-262 1st edition | 1.3 | |
| 5.0 | Mar 1999 | Internet Explorer 5.0 | ECMA-262 2nd edition | 1.4 |
| 5.1 | Internet Explorer 5.01 | ECMA-262 2nd edition | 1.4 | |
| 5.5 | Jul 2000 | Internet Explorer 5.5 &Windows CE 4.2 | ECMA-262 3rd edition | 1.5 |
| 5.6 | Oct 2001 | Internet Explorer 6.0 &Windows CE 5.0 | ECMA-262 3rd edition | 1.5 |
| 5.7 | Nov 2006 | Internet Explorer 7.0 | ECMA-262 3rd edition[19] + ECMA-327 (ES-CP)[note 3] | 1.5 |
| 5.8 | Mar 2009 | Internet Explorer 8.0 &Internet Explorer Mobile 6.0 | ECMA-262 3rd edition + ECMA-327 (ES-CP)[note 3] +JSON (RFC 4627) | 1.5 |
| 11.0 | Jun 2024 | Windows 11 version 24H2 | (JScript 9 Legacy, designed as a compatible drop-in replacement for JScript 5.8, but not 100% compatible[20]) | 1.5 |
JScript is also available on Windows CE (included in Windows Mobile, optional in Windows Embedded CE). The Windows CE version lacks Active Debugging.
Managed JScript is an implementation of JScript for theDynamic Language Runtime, it is part of Microsoft's dynamic languages for .NET along withIronRuby,IronPython, andDynamic Visual Basic.Unlike JScript .NET, which is less dynamic than the original JScript but providesCommon Language Infrastructure (CLI) compatibility, Managed JScript is designed on top of theDynamic Language Runtime (DLR) and provides the features needed for scripting scenarios.
While it is primarily designed to be used withinSilverlight and ASP.NET at this time, it can also easily be embedded within any .NET application.[21]
Two builds of Managed JScript exist: one for the DesktopCommon Language Runtime (CLR) and one for theSilverlight CoreCLR
| Version | Date | Introduced with | Based on | Platform |
|---|---|---|---|---|
| 1.0.0.0 | 2007 | ASP.NET Futures (July 2007 preview) | ECMA-262 3rd edition | DesktopCLR 2.0 |
| 1.1.20625.0 | 2007 | Microsoft Silverlight 1.1 Alpha (Sep 2007 refresh) | ECMA-262 3rd edition | CoreCLR 1.1 |
Managed JScript is unsupported in the.NET Compact Framework.
(Source: files versions of Microsoft.JScript.Runtime.dll in ASP.NET Futures and Silverlight 1.1 folders)
JScript "Chakra" is based on the JScript (COM classic) version, but it has been redesigned to improve performance inInternet Explorer 9[22] at the expense of proper Active Scripting engine compatibility. It requires a specific Microsoft JavaScript Hosting (JsRT) API for proper use. Therefore, it is installed side by side with JScript 5.x and is only used byInternet Explorer 9 and later as well as JsRT hosts, while other Active Scripting hosts keep using the 5.x version when requesting the JScript engine.
| Version | Date | Introduced with[23] | Based on[24] | SimilarJavaScript version |
|---|---|---|---|---|
| Chakra 9.0 | Mar 2011 | Internet Explorer 9.0 | ECMA-262 5th edition | 1.8.1 |
| Chakra 10.0 | Sep 2012 | Internet Explorer 10.0 | ECMA-262 5.1 edition | |
| Chakra 11.0 | Oct 2013 | Internet Explorer 11.0 | ECMA-262 6th edition | |
| Chakra Edge | Jul 2015 | Edge [Legacy] /Windows 10 | ECMA-262 5.1 to 9 (2018) edition (kept up to date without engine versioning) |
There are two versions of the Chakra JsRT engine.The original one was used byInternet Explorer 9 and later, and is sometimes referred to as "jscript9.dll" or "legacy Chakra engine", and a second one used byMicrosoft Edge Legacy browser and sometimes referred to as "new Chakra engine", "Edge engine" or "Chakra.dll".Both Chakra JsRT versions can be used by other applications using the JsRT API and can be installed side by side.[25]
There is also aCOM Classic version of Chakra internally called "JScript 9 Legacy" (provided by jscript9Legacy.dll), introduced with Windows 11 24H2, which brings back compatibility with Active Scripting hosts and intended as a compatible drop-in replacement for JScript 5.8. Although largely compatible with the original JScript 5.8, there are notable breaking differences.[26]
See separate page about newChakra (Edge) engine.
JScript .NET is aMicrosoft .NET implementation of JScript. It is aCLI language and thus inherits very powerful features, but lacks many features of the original JScript language, making it inappropriate for many scripting scenarios.JScript .NET can be used forASP.NET pages and for complete .NET applications, but the lack of support for this language in Microsoft Visual Studio places it more as an upgrade path for classicASP using classic JScript than as a new first-class language.
| Version | Platform | Date | Introduced with | Based on |
|---|---|---|---|---|
| 7.0 | DesktopCLR 1.0 | 2002-01-05 | .NET Framework 1.0 | ECMA-262 3rd edition[note 4] |
| 7.1 | DesktopCLR 1.1 | 2003-04-01 | .NET Framework 1.1 | ECMA-262 3rd edition[note 4] |
| 8.0 | DesktopCLR 2.0 | 2005-11-07 | .NET Framework 2.0 | ECMA-262 3rd edition[note 4] |
| 10.0 | DesktopCLR 4.0 | 2010-08-03 | .NET Framework 4.0 | ECMA-262 3rd edition[note 4] |
JScript .NET is unsupported in the.NET Compact Framework.[citation needed]
JScript .NET versions are unrelated to classic JScript versions, and are a separate product line. Even though JScript .NET is unsupported within the Visual Studio IDE, its versions are in sync with other .NET languages versions (C#,VB.NET,VC++) that follow their corresponding Visual Studio versions.
.NET Framework 3.0 and 3.5 are built on 2.0 and do not include the newer JScript.NET release (version 10.0 for .NET Framework 4.0).
(Source: file version of jsc.exe JScript.NET compiler and Microsoft.JScript.dll installed with .NET Framework)