Implementation of ECMAScript by Microsoft
JScript is Microsoft's dialect of the ECMAScript standard[2] that is used in Microsoft's Internet Explorer.
JScript is implemented as an Active Scripting engine. This means that it can be "plugged in" to OLE Automation applications that support Active Scripting, such as Internet Explorer, Active Server Pages, and Windows Script Host.[3] It also means such applications can use multiple Active Scripting languages, e.g., JScript, VBScript or PerlScript.
JScript was first supported in the Internet Explorer 3.0 browser released in August 1996. Its most recent version is JScript 9.0, included in Internet Explorer 9.
JScript 10.0[4] is a separate dialect, also known as JScript .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.
Comparison to JavaScript[edit]
As explained by Douglas Crockford in his talk titled The JavaScript Programming Language on YUI Theater,
[Microsoft] did not want to deal with Sun 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.[5]
However, JScript supports conditional compilation, which allows a programmer to selectively execute code within block comments. This is an extension to the ECMAScript standard that is not supported in other JavaScript implementations, thus making the above statement not completely 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 the Microsoft Developer Network (MSDN).[6] Although, the default type value for the script element in Internet Explorer is JavaScript, while JScript was its alias.[7] In an apparent transition from JScript to JavaScript, online, the Microsoft Edge Developer Guide refers to the Mozilla MDN web reference library as its definitive documentation.[8] As of October 2017, Microsoft MSDN pages for scripting in Internet Explorer are being redirected there as well.[9] This information may not include JScript specific objects, such as Enumerator, which are listed in the JavaScript language reference on Microsoft Docs.[10] Those provide additional features that are not included in the ECMA Standards, whether they are supported in the Edge browser or its predecessor.[11]
Versions[edit]
JScript (COM Classic)[12][edit]
The original JScript is an Active Scripting engine. Like other Active Scripting languages, it is built on the COM/OLE Automation platform and provides scripting capabilities to host applications.
This is the version used when hosting JScript inside a Web page displayed by Internet Explorer, in an HTML application before IE9, as well as in classic ASP, Windows Script Host scripts and other Automation 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 with Internet Explorer 7.0 and is also installed for Internet Explorer 6.0 with Windows XP Service Pack 3, while JScript 5.8 was introduced with Internet Explorer 8.0 and is also installed with Internet Explorer 6.0 on Windows Mobile 6.5.
Microsoft's implementation of ECMAScript 5th Edition in Windows 8 Consumer Preview is called JavaScript and the corresponding Visual Studio 11 Express Beta includes a “completely new”, full-featured JavaScript editor with IntelliSense enhancements for HTML5 and ECMAScript 5 syntax, “VSDOC” annotations for multiple overloads, simplified DOM configuration, brace matching, collapsible outlining and “go to definition”.[13]
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[edit]
Managed JScript is an implementation of JScript for the Dynamic Language Runtime, it is part of Microsoft's dynamic languages for .NET along with IronRuby, IronPython, and Dynamic Visual Basic. Unlike JScript .NET, which is less dynamic than the original JScript but provides CLS compatibility, Managed JScript is designed on top of the DLR and provides the features needed for scripting scenarios.
While it is primarily designed to be used within Silverlight and ASP.NET at this time, it can also easily be embedded within any .NET application.
(Source: JScript Blog, Jim Hugunin's Thinking Dynamic blog, Source: Blog of Jitu)
Two builds of Managed JScript exists, one for the Desktop CLR and one for the CoreCLR (Microsoft Silverlight)
Version | Date | Introduced with | Based on | Platform |
---|---|---|---|---|
1.0.0.0 | 2007 | ASP.NET Futures (July 2007 preview) | ECMA-262 3rd edition | Desktop CLR 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 not supported in the .NET Compact Framework.
(Source: files versions of Microsoft.JScript.Runtime.dll in ASP.NET Futures and Silverlight 1.1 folders)
JScript "Chakra" (JsRT)[17][edit]
JScript "Chakra" is based on the JScript (COM classic) version, but it has been redesigned to improve performance in Internet Explorer 9 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 by Internet 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.
There are two versions of the Chakra engine, the original one used by Internet Explorer 9 and later, and sometimes referred to as "jscript9.dll" or "legacy Chakra engine", and a second one used by Microsoft Edge browser and sometimes referred to as "new Chakra engine", "Edge engine" or "Chakra.dll". Both Chakra versions can be used by other applications using the JsRT API and can be installed side by side.[20]
See separate page about new Chakra (Edge) engine.
JScript .NET (CLI)[edit]
JScript .NET is a Microsoft .NET implementation of JScript. It is a CLI 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 for ASP.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 classic ASP using classic JScript than as a new first-class language.
JScript .NET is not supported in the .NET Compact Framework.[citation needed]
Note: JScript .NET versions are not related to classic JScript versions. JScript .NET is a separate product. Even though JScript .NET is not supported 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 top of 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)
See also[edit]
- ^ JScript supports various features not specified in the ECMA standard,[15] as does JavaScript.
- ^ Microsoft said JScript 3.0 was "the first scripting language to fully conform to the ECMA-262 standard".[16]
- ^ JScript 5.7 includes an implementation of the ECMAScript Compact Profile (ECMA-327) which turns off features not required by the ES-CP when using the "JScript.Compact" ProgID.[citation needed]
- ^ a b c d JScript .NET is "being developed in conjunction with ECMAScript Edition 4".[21]
References[edit]
- ^ "Types of Script Files". Msdn.microsoft.com. Retrieved 2012-08-17.
- ^ "JScript (ECMAScript3)". Msdn.microsoft.com. Retrieved 2012-08-17.
- ^ "What Is WSH?". Msdn.microsoft.com. Retrieved 2012-08-17.
- ^ What is JScript 10.0?
- ^ Douglas Crockford, The JavaScript Programming Language
- ^ "The World of JScript, JavaScript, ECMAScript". Blogs.msdn.microsoft.com. Retrieved 2017-10-21.
- ^ "script element". Msdn.microsoft.com. Retrieved 2017-10-16.
- ^ "Microsoft-Edge Dev-Guide". Docs.microsoft.com. Retrieved 2017-10-18.
- ^ "Documenting the Web Together". Blogs.windows.com. Retrieved 2017-10-18.
- ^ "Javascript Language Reference (Microsoft Docs)". Docs.microsoft.com. Retrieved 2017-10-18.
- ^ "JavaScript Objects (Microsoft Docs)". Docs.microsoft.com. Retrieved 2017-10-18.
- ^ Lakshman, Pratap. "JScript Deviations from ES3" (PDF). The Register. Situation Publishing / Microsoft. Retrieved 9 February 2020.
- ^ "What's New in ASP.NET 4.5 and Visual Web Developer 11 Beta: The Official Microsoft ASP.NET Site".
"What's New for ASP.NET 4.5 and Web Development in Visual Studio 11 Beta". - ^ Version Information (Windows Scripting – JScript), Microsoft, retrieved 2010-05-31
- ^ Microsoft JScript Features – Non-ECMA (Windows Scripting – JScript), Microsoft, retrieved 2010-05-31
- ^ Microsoft Embraces ECMA Internet Scripting Standard; Delivers Industry's First ECMA-Compliant Scripting Language, JScript 3.0, In Key Microsoft Products, Microsoft, 1997-06-30, archived from the original on 2009-01-12
- ^ Niyogi, Shanku. "The New JavaScript Engine in Internet Explorer 9". IEBlog (archives). Microsoft. Retrieved 19 February 2020.
- ^ Version Information (Windows Scripting – JScript), Microsoft, retrieved 2010-05-31
- ^ "Internet Explorer Standards Support Documents". Open Specifications (Microsoft Docs). Microsoft. Retrieved 19 February 2020.
- ^ "Targeting Microsoft Edge vs. Legacy Engines in JsRT APIs". Microsoft Edge documentation (Microsoft Docs). Microsoft. Retrieved 19 February 2020.
- ^ What Is JScript .NET?, Microsoft
External links[edit]
from Hacker News https://ift.tt/3gHFEcV
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.