JScript: Difference between revisions
imported>Explicit |
imported>Jerryobject Parameter fill. WP:LINKs: update-standardize, adds. |
||
| (One intermediate revision by the same user not shown) | |||
| Line 2: | Line 2: | ||
{{Distinguish|JavaScript}} | {{Distinguish|JavaScript}} | ||
{{Infobox programming language | {{Infobox programming language | ||
| name | | name = JScript | ||
| logo | | logo = Jscript icon.gif | ||
| | | logo size = 60px | ||
| | | paradigms = [[Comparison of multi-paradigm programming languages||Multi-paradigm]]: [[Object-oriented programming|object-oriented]] ([[Prototype-based programming|prototype-based]]), [[Functional programming|functional]], [[Imperative programming|imperative]], [[Scripting language|scripting]] | ||
| family = [[ECMAScript]] | |||
| designer = | |||
| developer = [[Microsoft]] | |||
| released = {{Start date and age|1996}} | |||
| latest release version = 9.0 | |||
| latest release date = {{Start date and age|2011|03}} | |||
| implementations | | discontinued = yes | ||
| dialects | | typing = [[Dynamic typing|dynamic]], [[Strong and weak typing|weak]], [[duck typing|duck]] | ||
| influenced by | | scope = [[Scope (computer science)|lexical]] | ||
| operating system = [[Microsoft Windows]] | |||
| license = [[Proprietary software|proprietary]] | |||
| | | file ext = <code>[[.js]]</code>, <code>.jse</code>, <code>[[.wsf]]</code>, <code>.wsc</code> (<code>[[.htm]]</code>, <code>[[.html]]</code>, <code>[[HTML Application|.hta]]</code>, <code>[[Active Server Pages|.asp]]</code>)<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/67w03h17(v=VS.85).aspx |title=Types of Script Files |date=24 October 2011 |publisher=Msdn.microsoft.com |access-date=2012-08-17}}</ref> | ||
| website = {{URL|1=https://learn.microsoft.com/en-us/previous-versions/hbxc2t98(v=vs.85)}} | |||
| implementations = [[Active Scripting]], [[JScript .NET]] | |||
| dialects = | |||
| influenced by = [[JavaScript]] | |||
| influenced = | |||
}} | }} | ||
'''JScript''' is Microsoft's [[ | '''JScript''' is Microsoft's [[Legacy system|legacy]]<ref>{{Cite web |date=2020-10-13 |title=Disabling legacy scripting engine JScript in Internet Explorer |url=https://techcommunity.microsoft.com/t5/windows-it-pro-blog/disabling-legacy-scripting-engine-jscript-in-internet-explorer/ba-p/1777563 |access-date=2021-11-15 |website=Techcommunity Microsoft. com |language=en}}</ref> dialect of the [[ECMAScript]] standard<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/hbxc2t98(v=vs.85).aspx |title=JScript (ECMAScript3) |date=24 October 2011 |publisher=Msdn.microsoft.com |access-date=2012-08-17}}</ref> that is used in [[Microsoft]]'s [[Internet Explorer]] web browser and [[HTML Application]]s, and as a standalone Windows scripting language. It is [[proprietary software]]. | ||
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]].<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/shzd7dy4(v=VS.85).aspx |title=What Is WSH? |date=24 October 2011 |publisher=Msdn.microsoft.com |access-date=2012-08-17}}</ref> It also means such applications can use multiple Active Scripting languages, e.g., JScript, [[VBScript]] or [[PerlScript]]. | 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]].<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/shzd7dy4(v=VS.85).aspx |title=What Is WSH? |date=24 October 2011 |publisher=Msdn.microsoft.com |access-date=2012-08-17}}</ref> It also means such applications can use multiple Active Scripting languages, e.g., JScript, [[VBScript]] or [[PerlScript]]. | ||
| Line 31: | Line 35: | ||
== Comparison to JavaScript == | == Comparison to JavaScript == | ||
As explained by [[Douglas Crockford]] in his talk titled ''The JavaScript Programming Language'' on YUI Theater, {{ | As explained by [[Douglas Crockford]] in his talk titled ''The JavaScript Programming Language'' on YUI Theater, {{Blockquote|[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.<ref>Douglas Crockford, ''The JavaScript Programming Language''</ref>}} | ||
However, JScript supports conditional compilation, which allows a programmer to selectively execute code within [[block comments]]. | 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 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 the [[Microsoft Developer Network]] (MSDN).<ref>{{cite web|url=https://blogs.msdn.microsoft.com/gauravseth/2007/08/15/the-world-of-jscript-javascript-ecmascript/ |title=The World of JScript, JavaScript, ECMAScript |date=15 August 2007 |publisher=Blogs.msdn.microsoft.com |access-date=2017-10-21}}</ref> The default type value for the script element in Internet Explorer is JavaScript, while JScript was its alias.<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/ms535892(v=vs.85).aspx |title=script element |publisher=Msdn.microsoft.com |access-date=2017-10-16}}</ref> 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.<ref>{{cite web|url=https://docs.microsoft.com/en-us/microsoft-edge/dev-guide |title=Microsoft-Edge Dev-Guide |publisher=Docs.microsoft.com |access-date=2017-10-18}}</ref> As of October 2017, Microsoft MSDN pages for scripting in Internet Explorer are being redirected there as well.<ref>{{cite web|url=https://blogs.windows.com/msedgedev/2017/10/18/documenting-web-together-mdn-web-docs/ |title=Documenting the Web Together |date=18 October 2017 |publisher=Blogs.windows.com |access-date=2017-10-18}}</ref> This information may not include JScript specific objects, such as Enumerator, which are listed in the JavaScript language reference on Microsoft Docs.<ref>{{cite web|url=https://docs.microsoft.com/en-us/scripting/javascript/javascript-language-reference |title=Javascript Language Reference (Microsoft Docs) |publisher=Docs.microsoft.com |access-date=2017-10-18}}</ref> Those provide additional features that are not included in the ECMA Standards, whether they are supported in the [[Microsoft Edge Legacy|Edge [Legacy] browser]] or its predecessor.<ref>{{cite web|url=https://docs.microsoft.com/en-us/scripting/javascript/reference/javascript-objects |title=JavaScript Objects (Microsoft Docs) |publisher=Docs.microsoft.com |access-date=2017-10-18}}</ref> | Other internal implementation differences between JavaScript and JScript, at some point in time, are noted on the [[Microsoft Developer Network]] (MSDN).<ref>{{cite web|url=https://blogs.msdn.microsoft.com/gauravseth/2007/08/15/the-world-of-jscript-javascript-ecmascript/ |title=The World of JScript, JavaScript, ECMAScript |date=15 August 2007 |publisher=Blogs.msdn.microsoft.com |access-date=2017-10-21}}</ref> The default type value for the script element in Internet Explorer is JavaScript, while JScript was its alias.<ref>{{cite web|url=https://msdn.microsoft.com/en-us/library/ms535892(v=vs.85).aspx |title=script element |publisher=Msdn.microsoft.com |access-date=2017-10-16}}</ref> 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.<ref>{{cite web|url=https://docs.microsoft.com/en-us/microsoft-edge/dev-guide |title=Microsoft-Edge Dev-Guide |publisher=Docs.microsoft.com |access-date=2017-10-18}}</ref> As of October 2017, Microsoft MSDN pages for scripting in Internet Explorer are being redirected there as well.<ref>{{cite web|url=https://blogs.windows.com/msedgedev/2017/10/18/documenting-web-together-mdn-web-docs/ |title=Documenting the Web Together |date=18 October 2017 |publisher=Blogs.windows.com |access-date=2017-10-18}}</ref> This information may not include JScript specific objects, such as Enumerator, which are listed in the JavaScript language reference on Microsoft Docs.<ref>{{cite web|url=https://docs.microsoft.com/en-us/scripting/javascript/javascript-language-reference |title=Javascript Language Reference (Microsoft Docs) |publisher=Docs.microsoft.com |access-date=2017-10-18}}</ref> Those provide additional features that are not included in the ECMA Standards, whether they are supported in the [[Microsoft Edge Legacy|Edge [Legacy] browser]] or its predecessor.<ref>{{cite web|url=https://docs.microsoft.com/en-us/scripting/javascript/reference/javascript-objects |title=JavaScript Objects (Microsoft Docs) |publisher=Docs.microsoft.com |access-date=2017-10-18}}</ref> | ||
| Line 43: | Line 47: | ||
This is the version used when hosting JScript inside a Web page displayed by [[Internet Explorer]], in an [[HTA (programming language)|HTML application]] before [[Internet Explorer 9|IE9]], as well as in [[Active Server Pages|classic ASP]], [[Windows Script Host]] scripts and other [[OLE Automation|Automation]] environments. | This is the version used when hosting JScript inside a Web page displayed by [[Internet Explorer]], in an [[HTA (programming language)|HTML application]] before [[Internet Explorer 9|IE9]], as well as in [[Active Server Pages|classic ASP]], [[Windows Script Host]] scripts and other [[OLE Automation|Automation]] environments. | ||
JScript is sometimes referred to as "classic JScript" or "Active Scripting JScript" to differentiate it from newer .NET-based versions. | 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 | 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]] [[XP service pack 3|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#Windows Mobile 6.5|Windows Mobile 6.5]]. | ||
Microsoft's implementation of ECMAScript 5th Edition in [[Windows 8#Consumer Preview|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 [[Document Object Model|DOM]] configuration, brace matching, collapsible outlining and "go to definition".<ref name="vs11beta">{{cite web |url=http://www.asp.net/vnext/overview/whitepapers/whats-new#_Toc318097407 |title=What's New in ASP.NET 4.5 and Visual Web Developer 11 Beta: The Official Microsoft ASP.NET Site |date=13 May 2022 }}<br>{{cite web |url=https://msdn.microsoft.com/en-us/library/hh420390(v=vs.110).aspx#javascript_editor |title=What's New for ASP.NET 4.5 and Web Development in Visual Studio 11 Beta |date=12 May 2015 }}</ref> | Microsoft's implementation of ECMAScript 5th Edition in [[Windows 8#Consumer Preview|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 [[Document Object Model|DOM]] configuration, brace matching, collapsible outlining and "go to definition".<ref name="vs11beta">{{cite web |url=http://www.asp.net/vnext/overview/whitepapers/whats-new#_Toc318097407 |title=What's New in ASP.NET 4.5 and Visual Web Developer 11 Beta: The Official Microsoft ASP.NET Site |date=13 May 2022}}<br>{{cite web |url=https://msdn.microsoft.com/en-us/library/hh420390(v=vs.110).aspx#javascript_editor |title=What's New for ASP.NET 4.5 and Web Development in Visual Studio 11 Beta |date=12 May 2015}}</ref> | ||
{| class="wikitable" style="text-align: center;" | {| class="wikitable" style="text-align: center;" | ||
| Line 83: | Line 87: | ||
| 5.0 | | 5.0 | ||
| Mar 1999 | | Mar 1999 | ||
| [[Internet Explorer 5.0 | | [[Internet Explorer 5]].0 | ||
| ECMA-262 2nd edition | | ECMA-262 2nd edition | ||
| 1.4 | | 1.4 | ||
| Line 101: | Line 105: | ||
| 5.6 | | 5.6 | ||
| Oct 2001 | | Oct 2001 | ||
| [[Internet Explorer 6 | | [[Internet Explorer 6]].0 & [[Windows CE]] 5.0 | ||
| ECMA-262 3rd edition | | ECMA-262 3rd edition | ||
| 1.5 | | 1.5 | ||
| Line 107: | Line 111: | ||
| 5.7 | | 5.7 | ||
| Nov 2006 | | Nov 2006 | ||
| [[Internet Explorer 7 | | [[Internet Explorer 7]].0 | ||
| ECMA-262 3rd edition<ref>{{cite web |last1=Lakshman |first1=Pratap |title=JScript Deviations from ES3 |url=http://regmedia.co.uk/2007/10/31/jscriptdeviationsfromes3.pdf |website=The Register |publisher=Situation Publishing / Microsoft |access-date=9 February 2020}}</ref> + ECMA-327 (ES-CP){{refn|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|date=May 2010}}|group=note|name=ES-CP}} | | ECMA-262 3rd edition<ref>{{cite web |last1=Lakshman |first1=Pratap |title=JScript Deviations from ES3 |url=http://regmedia.co.uk/2007/10/31/jscriptdeviationsfromes3.pdf |website=The Register |publisher=Situation Publishing / Microsoft |access-date=9 February 2020}}</ref> + ECMA-327 (ES-CP){{refn|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|date=May 2010}}|group=note|name=ES-CP}} | ||
| 1.5 | | 1.5 | ||
| Line 113: | Line 117: | ||
| 5.8 | | 5.8 | ||
| Mar 2009 | | Mar 2009 | ||
| [[Internet Explorer 8 | | [[Internet Explorer 8]].0 & [[Internet Explorer Mobile]] 6.0 | ||
| ECMA-262 3rd edition + ECMA-327 (ES-CP){{refn|group=note|name=ES-CP}} + [[JSON]] (RFC 4627) | | ECMA-262 3rd edition + ECMA-327 (ES-CP){{refn|group=note|name=ES-CP}} + [[JSON]] (RFC 4627) | ||
| 1.5 | | 1.5 | ||
| Line 120: | Line 124: | ||
| Jun 2024 | | Jun 2024 | ||
| [[Windows 11, version 22H2|Windows 11 version 24H2]] | | [[Windows 11, version 22H2|Windows 11 version 24H2]] | ||
| (JScript 9 Legacy, designed as a compatible drop-in replacement for JScript 5.8, but not 100% compatible<ref>{{cite web | url=https://learn.microsoft.com/en-us/answers/questions/1071647/windows-11-22h2-has-a-different-way-of-using-the-j | title=Windows 11 22H2 has a different way of using the JS engine? - Microsoft Q&A }}</ref>) | | (JScript 9 Legacy, designed as a compatible drop-in replacement for JScript 5.8, but not 100% compatible<ref>{{cite web |url=https://learn.microsoft.com/en-us/answers/questions/1071647/windows-11-22h2-has-a-different-way-of-using-the-j |title=Windows 11 22H2 has a different way of using the JS engine? - Microsoft Q&A}}</ref>) | ||
| 1.5 | | 1.5 | ||
|} | |} | ||
| Line 128: | Line 132: | ||
=== Managed JScript === | === Managed JScript === | ||
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 [[Visual Basic|Dynamic Visual Basic]]. | 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 [[Visual Basic|Dynamic Visual Basic]]. | ||
Unlike JScript .NET, which is less dynamic than the original JScript but provides [[Common Language | Unlike JScript .NET, which is less dynamic than the original JScript but provides [[Common Language Infrastructure]] (CLI) compatibility, Managed JScript is designed on top of the [[Dynamic Language Runtime]] (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.<ref>(Source: [http://blogs.msdn.com/jscript/archive/2007/05/04/managed-jscript-announced.aspx JScript Blog], [http://blogs.msdn.com/hugunin/archive/2007/04/30/a-dynamic-language-runtime-dlr.aspx Jim Hugunin's Thinking Dynamic blog], | While it is primarily designed to be used within [[Microsoft Silverlight|Silverlight]] and ASP.NET at this time, it can also easily be embedded within any .NET application.<ref>(Source: [http://blogs.msdn.com/jscript/archive/2007/05/04/managed-jscript-announced.aspx JScript Blog], [http://blogs.msdn.com/hugunin/archive/2007/04/30/a-dynamic-language-runtime-dlr.aspx Jim Hugunin's Thinking Dynamic blog], | ||
Source: [http://blogs.msdn.com/jitu/archive/2007/05/04/introducing-managed-jscript.aspx Blog of Jitu])</ref> | Source: [http://blogs.msdn.com/jitu/archive/2007/05/04/introducing-managed-jscript.aspx Blog of Jitu])</ref> | ||
Two builds of Managed JScript exist: one for the Desktop [[Common Language Runtime | Two builds of Managed JScript exist: one for the Desktop [[Common Language Runtime]] (CLR) and one for the [[Microsoft Silverlight|Silverlight]] CoreCLR | ||
{| class="wikitable" | {| class="wikitable" | ||
! Version | ! Version | ||
| Line 143: | Line 147: | ||
| 1.0.0.0 || 2007 || [[ASP.NET]] Futures (July 2007 preview) || ECMA-262 3rd edition || Desktop [[Common Language Runtime|CLR]] 2.0 | | 1.0.0.0 || 2007 || [[ASP.NET]] Futures (July 2007 preview) || ECMA-262 3rd edition || Desktop [[Common Language Runtime|CLR]] 2.0 | ||
|- | |- | ||
| 1.1.20625.0 || 2007 || [[ | | 1.1.20625.0 || 2007 || [[Microsoft Silverlight]] 1.1 Alpha (Sep 2007 refresh) || ECMA-262 3rd edition || [[Microsoft Silverlight|CoreCLR]] 1.1 | ||
|} | |} | ||
Managed JScript is | 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) | (Source: files versions of Microsoft.JScript.Runtime.dll in ASP.NET Futures and Silverlight 1.1 folders) | ||
| Line 192: | Line 196: | ||
Both Chakra JsRT versions can be used by other applications using the JsRT API and can be installed side by side.<ref>{{cite web |title=Targeting Microsoft Edge vs. Legacy Engines in JsRT APIs |url=https://docs.microsoft.com/en-us/microsoft-edge/hosting/chakra-hosting/targeting-edge-vs-legacy-engines-in-jsrt-apis |website=Microsoft Edge documentation (Microsoft Docs) |publisher=Microsoft |access-date=19 February 2020 |language=en-us}}</ref> | Both Chakra JsRT versions can be used by other applications using the JsRT API and can be installed side by side.<ref>{{cite web |title=Targeting Microsoft Edge vs. Legacy Engines in JsRT APIs |url=https://docs.microsoft.com/en-us/microsoft-edge/hosting/chakra-hosting/targeting-edge-vs-legacy-engines-in-jsrt-apis |website=Microsoft Edge documentation (Microsoft Docs) |publisher=Microsoft |access-date=19 February 2020 |language=en-us}}</ref> | ||
There is also a [[# | There is also a [[#JScript (COM Classic)|COM 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.<ref>{{cite web |url=https://learn.microsoft.com/en-us/answers/questions/1071647/windows-11-22h2-has-a-different-way-of-using-the-j |title=Windows 11 22H2 has a different way of using the JS engine? - Microsoft Q&A}}</ref> | ||
See separate page about [[Chakra (JavaScript engine)| | See separate page about new [[Chakra (JavaScript engine)|Chakra (Edge) engine]]. | ||
=== JScript .NET (CLI) === | === JScript .NET (CLI) === | ||
{{Main|JScript .NET}} | {{Main|JScript .NET}} | ||
JScript .NET is a [[Microsoft .NET]] implementation of JScript. It is a [[Common Language | JScript .NET is a [[Microsoft .NET strategy|Microsoft .NET]] implementation of JScript. It is a [[Common Language Infrastructure|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 [[Active Server Pages|ASP]] using classic JScript than as a new first-class language. | 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 [[Active Server Pages|ASP]] using classic JScript than as a new first-class language. | ||
| Line 209: | Line 213: | ||
! Based on | ! Based on | ||
|- | |- | ||
| 7.0 || Desktop [[Common Language Runtime|CLR]] 1.0 || 2002-01-05 || [[ | | 7.0 || Desktop [[Common Language Runtime|CLR]] 1.0 || 2002-01-05 || [[.NET Framework]] 1.0 || ECMA-262 3rd edition{{refn|JScript .NET is "being developed in conjunction with ECMAScript Edition 4".<ref>{{citation |url=https://msdn.microsoft.com/en-us/library/xkx7dfw1(VS.71).aspx |title=What Is JScript .NET? |publisher=Microsoft}}</ref>|group=note|name=dotnet}} | ||
|- | |- | ||
| 7.1 || Desktop [[Common Language Runtime|CLR]] 1.1 || 2003-04-01 || [[ | | 7.1 || Desktop [[Common Language Runtime|CLR]] 1.1 || 2003-04-01 || [[.NET Framework]] 1.1 || ECMA-262 3rd edition<ref group="note" name="dotnet" /> | ||
|- | |- | ||
| 8.0 || Desktop [[Common Language Runtime|CLR]] 2.0 || 2005-11-07 || [[ | | 8.0 || Desktop [[Common Language Runtime|CLR]] 2.0 || 2005-11-07 || [[.NET Framework]] 2.0 || ECMA-262 3rd edition<ref group="note" name="dotnet" /> | ||
|- | |- | ||
|10.0 || Desktop [[Common Language Runtime|CLR]] 4.0 || 2010-08-03 || [[ | |10.0 || Desktop [[Common Language Runtime|CLR]] 4.0 || 2010-08-03 || [[.NET Framework]] 4.0 || ECMA-262 3rd edition<ref group="note" name="dotnet" /> | ||
|} | |} | ||
JScript .NET is | JScript .NET is unsupported in the [[.NET Compact Framework]].{{citation needed|date=March 2012}} | ||
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 Sharp (programming language)|C#]], [[VB.NET]], [[VC++]]) that follow their corresponding Visual Studio versions. | |||
.NET Framework 3.0 and 3.5 are built on | .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) | (Source: file version of jsc.exe JScript.NET compiler and Microsoft.JScript.dll installed with .NET Framework) | ||
| Line 233: | Line 237: | ||
== Notes == | == Notes == | ||
{{Reflist | group=note}} | {{Reflist|group=note}} | ||
== References == | == References == | ||
| Line 252: | Line 256: | ||
{{Microsoft APIs}} | {{Microsoft APIs}} | ||
{{Internet Explorer}} | {{Internet Explorer}} | ||
{{Windows | {{Microsoft Windows components}} | ||
{{Authority control}} | {{Authority control}} | ||
Latest revision as of 11:18, 25 June 2025
Template:Short description Script error: No such module "Distinguish". Script error: No such module "Infobox".Template:Template otherScript error: No such module "Check for unknown parameters". JScript is Microsoft's legacy[1] dialect of the ECMAScript standard[2] that is used in Microsoft's Internet Explorer web browser and HTML Applications, and as a standalone Windows scripting language. It is proprietary software.
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.
JScript has been criticized for being insecure and having multiple security bugs "exploited by nation-state actors",[5] leading Microsoft to add an option to disable it.[6]
Comparison to JavaScript
As explained by Douglas Crockford in his talk titled The JavaScript Programming Language on YUI Theater, <templatestyles src="Template:Blockquote/styles.css" />
[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.[7]
Script error: No such module "Check for unknown parameters".
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 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 the Microsoft Developer Network (MSDN).[8] The default type value for the script element in Internet Explorer is JavaScript, while JScript was its alias.[9] 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.[10] As of October 2017, Microsoft MSDN pages for scripting in Internet Explorer are being redirected there as well.[11] This information may not include JScript specific objects, such as Enumerator, which are listed in the JavaScript language reference on Microsoft Docs.[12] Those provide additional features that are not included in the ECMA Standards, whether they are supported in the Edge [Legacy] browser or its predecessor.[13]
Versions
JScript (COM Classic)
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".[14]
| Version | Date | Introduced with[15] | Based onTemplate:Refn | Similar JavaScript 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 editionTemplate:Refn | 1.3 |
| 4.0 | Visual Studio 6.0 (as part of Visual 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[16] + ECMA-327 (ES-CP)Template:Refn | 1.5 |
| 5.8 | Mar 2009 | Internet Explorer 8.0 & Internet Explorer Mobile 6.0 | ECMA-262 3rd edition + ECMA-327 (ES-CP)Template:Refn + 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[17]) | 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
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 Common Language Infrastructure (CLI) compatibility, Managed JScript is designed on top of the Dynamic Language Runtime (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.[18]
Two builds of Managed JScript exist: one for the Desktop Common Language Runtime (CLR) and one for the Silverlight CoreCLR
| 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 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" (JsRT)
Script error: No such module "Labelled list hatnote". JScript "Chakra" is based on the JScript (COM classic) version, but it has been redesigned to improve performance in Internet Explorer 9[19] 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.
| Version | Date | Introduced with[20] | Based on[21] | Similar JavaScript 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 by Internet Explorer 9 and later, and is sometimes referred to as "jscript9.dll" or "legacy Chakra engine", and a second one used by Microsoft 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.[22]
There is also a COM 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.[23]
See separate page about new Chakra (Edge) engine.
JScript .NET (CLI)
Script error: No such module "Labelled list hatnote". 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.
| Version | Platform | Date | Introduced with | Based on |
|---|---|---|---|---|
| 7.0 | Desktop CLR 1.0 | 2002-01-05 | .NET Framework 1.0 | ECMA-262 3rd editionTemplate:Refn |
| 7.1 | Desktop CLR 1.1 | 2003-04-01 | .NET Framework 1.1 | ECMA-262 3rd edition[note 1] |
| 8.0 | Desktop CLR 2.0 | 2005-11-07 | .NET Framework 2.0 | ECMA-262 3rd edition[note 1] |
| 10.0 | Desktop CLR 4.0 | 2010-08-03 | .NET Framework 4.0 | ECMA-262 3rd edition[note 1] |
JScript .NET is unsupported in the .NET Compact Framework.Script error: No such module "Unsubst".
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)
See also
Notes
References
External links
- JScript documentation in the MSDN Library
- JScript 5.7 Release Notes
- JScript .NET documentation in the MSDN Library
- JScript blog
- JavaScript – JScript – ECMAScript version history
- JScript Features – ECMA
- JScript Features – Non-ECMA
- New features in JavaScript (Microsoft Docs)
Template:ECMAScript Template:Microsoft APIs Template:Internet Explorer Template:Microsoft Windows components Template:Authority control
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ What is JScript 10.0?
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Douglas Crockford, The JavaScript Programming Language
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
Script error: No such module "citation/CS1". - ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ (Source: JScript Blog, Jim Hugunin's Thinking Dynamic blog, Source: Blog of Jitu)
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
- ↑ Script error: No such module "citation/CS1".
Cite error: <ref> tags exist for a group named "note", but no corresponding <references group="note"/> tag was found