Most Read Latest News Blog Resources

JavaScript revision aims for browser cohesion




April 16, 2009 — 
Ten years after the last major revision of the language, JavaScript is ready for an update. ECMA International, on April 9, released the final draft of its specification for ECMAScript Fifth Edition—more commonly known as JavaScript—with important changes around JSON support.

Fifth Edition now includes support for the JSON object encoding format. Additionally, the specification includes a strict mode that offers better error checking and improves the overall security of JavaScript applications.

Further confusing the nomenclature is the fact that ECMAScript, Fifth Edition, was developed under the enumeration of version 3.1. Brendan Eich, CTO of the Mozilla Corporation and the creator of JavaScript, was involved in the ECMAScript 3.1 specification process.

Much of the work done on this specification involved bringing individual browser functionalities into a more open standard. Eich said that the biggest change for developers will be the common availability of getters and setters, which have been in Firefox for some time and have trickled into other browsers over time.

Eich also highlighted what he's calling a reflective meta-programming API. “What it means is you can make objects that look more like host objects, the magic objects you can set in the Document Object Model,” said Eich.

Objects are now more secure too, added JavaScript's creator. “JSON has dethroned XML for pure data interchange,” said Eich. “But it has had to be implemented as a JavaScript library. You have to be careful how you use it. With this new codec as part of the standard, they don't have to worry about downloading the libraries. There are other improvements to the integrity of JSON, so when you make arrays and objects from decoding this string, you get arrays and objects, not some attack encoded inside it.”

Eich said that the Fifth Edition adds a strict mode, similar to sort that rose to prominence in the Perl community. He said strict mode is helpful when “I want to have more error checking, or have some sanity checks done. When you assign to a read-only property, it shouldn't just fail. With strict mode you get an exception. The hope is a lot of people will just turn it on. People got used to seeing 'use strict' at the top of their Perl code. This will help us evolve the language so that someday, many years down the road, we can make the general language stricter.”

Long language life
It's been a long, strange trip for this language with so many names. The last major update for JavaScript was published in 1999 when the ECMAScript Third Edition specification was completed. Since that time, ECMA International worked on a Fourth Edition, which was never completed. ECMA International claims that the work on version four was wrapped up into the Fifth Edition, which has now come to fruition.

Perhaps the most striking aspect of this updated JavaScript is the fact that it was authored by the three parties that attempted to fork JavaScript into their own languages over the past 15 years. Microsoft first created its compatible version of JavaScript in 1996, a year after JavaScript was announced by Netscape and Sun Microsystems. Microsoft's version was named JScript, and its implementation was emblematic of the browser wars that were igniting at the time.

Then, 10 years ago, Adobe Systems built its own JavaScript-like language for Flash, dubbing it ActionScript. The three disparate implementations of JavaScript struggled to work together, but the 1999 standardization by ECMA International of ECMAScript Third Edition calmed the waters.

For ECMAScript Fifth Edition, Adobe, Microsoft and Mozilla worked together with ECMA to bring cohesion to the language.  Other companies involved in the ECMAScript specification included Apple, Google, Opera and Yahoo.


Related Search Term(s): ECMAJavaScript


Share this link: http://www.sdtimes.com/link/33422
 

Add comment


Name*
Email*  
Country     


  • Comment
  • Preview
Loading



 
 
 
 
News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 
Download Current Issue
ISSUE 3/15/2010 PDF

Need Back Issues?
DOWNLOAD HERE

Receive the print Edition?


 
blogs tab
Google Code turns 5
Google Code Turns 5, and adds a Paxos Algorithm to make the system more stable and reliable.
03/17/2010 11:16 AM EST

Test your Visual Studio 2010 know-how
Microsoft is offering free beta certification exams for Visual Studio 2010.
03/17/2010 11:08 AM EST

Microsoft lifts the hood on IE9
Microsoft is previewing IE9.
03/16/2010 01:10 PM EST

 

Events calendar tab
3/22/2010 to 3/25/2010
Santa Clara, Calif.
The Eclipse Foundation

4/12/2010 to 4/14/2010
Las Vegas
Penton Media

4/12/2010 to 4/15/2010
Santa Clara, Calif.
O'Reilly Media

4/19/2010
New York City
Flagg Management

4/25/2010 to 4/28/2010
Overland Park, Kans.
IIUG