Search Results

Search found 90 results on 4 pages for 'ecmascript'.

Page 1/4 | 1 2 3 4  | Next Page >

  • what will EcmaScript 6 bring to the table for us

    - by user697296
    Our company ported moderate chunks of business logic to JavaScript. We compile the code with a minifier, which further improves performance. Since the language is dynamically typed, it lends itself well to obfuscation, which occurs as a byproduct of minification. We went to great efforts to ensure it positively screams, performance-wise. We can now do what we did before, faster, better, with less code, on more platforms. In summary, we are very satisfied with the current state of the language. I personally love the language especially for its cross-platform nature. So naturally, I read up a lot about the state of JavaScript compilers, performance and compatibility across as many browsers and platforms as I have time to research. The one theme which has been growing louder and louder these days, is the news about ECMAScript 6. So far, what I have been able to gather is that ES6 promises a better development experience; firstly by enabling new ways to do things, secondly by reporting errors early. This sounds great for those who are still waiting for the language to meet their needs before jumping on board. But we have already jumped on board in a big way. Sure, I expect that we will have to do ongoing maintenance and feature revisions on our code through the years, and that we would obviously make use of best practices at the time. But I don't see us refactoring major portions of it to take advantage of language features that are mostly intended to boost developer productivity. I keep wondering, what impact will the language advances ultimately have on our existing, well-written, well-performing code base? Is there something I am missing? Is there something we ought to look out for? Does anyone have tips or guidance on how we should approach the ecmascript.next finalization? Should we care?

    Read the article

  • Programming languages similar to ActionScript 3 / EcmaScript based

    - by Juanlu001
    I almost learned programming and OOP basic concepts with ActionScript 3 on the Flash Platform years ago. Some time has passed since then; I'm not a professional programmer, but I have written code in PHP, Fortran, and now Python. But, lately, I have missed ActionScript 3 OOP implementation, static typing and, I confess, curly braces. As Flash platform is slowly dying nowadays, I'm looking for an Open Sourced programming language similar to ActionScript 3. I've read about Java, which is the most similar one I found, but actually is the only one it doesn't interest me (I started to hate it after bad experiences with web applets). Any ideas? Edit: Added EcmaScript to the title and the tags; I think that is what I am looking for.

    Read the article

  • `this` in global scope in ECMAScript 6

    - by Nathan Wall
    I've tried looking in the ES6 draft myself, but I'm not sure where to look: Can someone tell me if this in ES6 necessarily refers to the global object? Will this object have same members as the global scope? If you could answer for ES5 that would be helpful as well. I know this in global scope refers to the global object in the browser and in most other ES environments, like Node. I just want to know if that's the defined behavior by the spec or if that's extended behavior that implementers have added (and if this behavior will continue in ES6 implementations). In addition, is the global object always the same thing as the global scope? Or are there distinctions? Update - Why I want to know: I am basically trying to figure out how to get the global object reliably in ES5 & 6. I can't rely on window because that's specific to the browser, nor can I rely on global because that's specific to environments like Node. I know this in Node can refer to module in module scope, but I think it still refers to global in global scope. I want a cross-environment ES5 & 6 compliant way to get the global object (if possible). It seems like in all the environments I know of this in global scope does that, but I want to know if it's part of the actual spec (and so reliable across any environment that I may not be familiar with). I also need to know if the global scope and the global object are the same thing by the spec. In other words will all variables in global scope be the same as globalobject.variable_name?

    Read the article

  • Why were namespaces removed from ECMAScript consideration?

    - by Bob
    Namespaces were once a consideration for ECMAScript (the old ECMAScript 4) but were taken out. As Brendan Eich says in this message: One of the use-cases for namespaces in ES4 was early binding (use namespace intrinsic), both for performance and for programmer comprehension -- no chance of runtime name binding disagreeing with any earlier binding. But early binding in any dynamic code loading scenario like the web requires a prioritization or reservation mechanism to avoid early versus late binding conflicts. Plus, as some JS implementors have noted with concern, multiple open namespaces impose runtime cost unless an implementation works significantly harder. For these reasons, namespaces and early binding (like packages before them, this past April) must go. But I'm not sure I understand all of that. What exactly is a prioritization or reservation mechanism and why would either of those be needed? Also, must early binding and namespaces go hand-in-hand? For some reason I can't wrap my head around the issues involved. Can anyone attempt a more fleshed out explanation? Also, why would namespaces impose runtime costs? In my mind I can't help but see little difference in concept between a namespace and a function using closures. For instance, Yahoo and Google both have YAHOO and google objects that "act like" namespaces in that they contain all of their public and private variables, functions, and objects within a single access point. So why, then, would a namespace be so significantly different in implementation? Maybe I just have a misconception as to what a namespace is exactly.

    Read the article

  • translating Ecmascript (Java,javascript,Actionscript) knowledge to Objective C

    - by eco_bach
    Hi Newcomer to Objective C and trying to translate concepts and sytax I know from ecmascript based languages to Objective C. Is it proper to think of the .h header file in ObjectiveC as an Interface in Actionscript? Lets take the following code example in Objective C which calls a method containing 2 arguments [myTextObject setString: @"Hello World" color: kWhiteColor]; In Actionscript(or javascript) would this be the same as calling 2 accessor methods on 'myTextObject'? ie myTextObject.setString("Hello World") myTextObject.color(kWhiteColor);

    Read the article

  • from ObjectiveC to ECMAscript

    - by eco_bach
    Going thru the excellent Apress books on Objective C. To help in my undertanding, I try and recode any Ojective C code samples in Java/Action-script. One common structure in method calls in ObjC leaves me a bit puzzled. -(id) initWithPressure: (float) pressure treadDepth: (float) treadDepth; (in ECMAscript)Would this be most similar to 1 method call with multiple arguments OR 2 method calls, each with a single argument?

    Read the article

  • Possible typos in ECMAScript 5 specification?

    - by Andy West
    Does anybody know why, at the end of section 7.6 of the ECMA-262, 5th Edition specification, the nonterminals UnicodeLetter, UnicodeCombiningMark, UnicodeDigit, UnicodeconnectorPunctuation, and UnicodeEscapeSequence are not followed by two colons? From section 5.1.6: Nonterminal symbols are shown in italic type. The definition of a nonterminal is introduced by the name of the nonterminal being defined followed by one or more colons. (The number of colons indicates to which grammar the production belongs.) Since lexical productions are distinguished by having two colons, and this is under "Lexical Conventions", I'm assuming that they meant to put the colons in. Does that sound right? Just making sure that these really are nonterminals and they really are part of the lexical grammar. EDIT: I noticed there have been votes to close this. Just to make my case about why this is programming-related, it is relevant to anyone wanting to implement an ECMAScript interpreter.

    Read the article

  • EcmaScript 5 browser implementation

    - by hojberg
    So Safari and Chrome have started in their betas to implement some ES5 stuff. For instance Object.create is in them. Do any of you know if there is a website that shows the progress made in the browsers? ATM i need to use Object.freeze, and wanted to see which browsers (if any) supported that yet.

    Read the article

  • ECMAScript : ajouts et modifications de la 5e édition qui introduisent des incompatibilités avec le 3e

    (une petite traduction rapide des changements impactant entre la v5 et la v3. les numéros correspondent aux chapitres de la norme) Ecma-362 alias EcmaScript5 Annex E Ajouts et modifications dans la 5e édition qui introduisent des incompatibilités avec le 3e édition 7.1: si des caractères de contrôle Unicode sont présent dans une expression String ou une expression d'ExpressionRegulière ils seront inclus dans la l'expression. alors que dans l'édition 3 ils étaient ignorés. 7.2: le caractère Unicode <BOM> (Byte Order Mark) est maintenant traité comme un whitespace alors qu'il provoquait une Syntax Error dans l'édition ...

    Read the article

  • Que nous réserve le futur de JavaScript ? Un ingénieur de Mozilla détaille les nouveautés d'ECMAScript 6

    Que nous réserve le futur de JavaScript ? Un ingénieur de Mozilla détaille les nouveautés d'ECMAScript 6 [IMG]http://idelways.developpez.com/news/images/ecmascript-6.png[/IMG] Dave Herman, ingénieur à Mozilla Labs et membre du TC39, était présent à la conférence YUIConf 2011 pour une présentation inédite de ce que nous réserve le futur du standard ECMAScript et du langage JavaScript. Cette spécification ne sera pas finalisée avant 2013, mais des implémentations devraient bientôt voir le jour sur Firefox et Chrome. Le support d'ECMAScript 6 sur ce dernier profitera de facto au framework Node.js articulé autour du moteur V8. Herman a souligné en début de keynot...

    Read the article

  • I need help translating this portion of the ECMAScript grammar?

    - by ChaosPandion
    I've been working on my own implementation of ECMAScript for quite some time now. I have basically done everything by hand to help gain a deep understanding of the process. Repeated attempts to analyze and understand this portion of the grammar have failed so I've been working on the run time instead. Now I am at a point were I will be working on object literals so I really need to polish my syntactic analyzer. Can anyone put this in terms a language parser novice could understand? My biggest source of confusion is the following: new MemberExpression Arguments This is supposed to be a member expression, but this seemingly conflicts with the following: NewExpression : MemberExpression new NewExpression Is a new expression a member expression or a left hand side expression? To be honest I am having trouble laying out the proper C# classes for the concrete grammar. MemberExpression : PrimaryExpression FunctionExpression MemberExpression [ Expression ] MemberExpression . IdentifierName new MemberExpression Arguments NewExpression : MemberExpression new NewExpression CallExpression : MemberExpression Arguments CallExpression Arguments CallExpression [ Expression ] CallExpression . IdentifierName LeftHandSideExpression : NewExpression CallExpression

    Read the article

  • How can I improve the recursion capabilities of my ECMAScript implementation?

    - by ChaosPandion
    After some resent tests I have found my implementation cannot handle very much recursion. Although after I ran a few tests in Firefox I found that this may be more common than I originally thought. I believe the basic problem is that my implementation requires 3 calls to make a function call. The first call is made to a method named Call that makes sure the call is being made to a callable object and gets the value of any arguments that are references. The second call is made to a method named Call which is defined in the ICallable interface. This method creates the new execution context and builds the lambda expression if it has not been created. The final call is made to the lambda that the function object encapsulates. Clearly making a function call is quite heavy but I am sure that with a little bit of tweaking I can make recursion a viable tool when using this implementation. public static object Call(ExecutionContext context, object value, object[] args) { var func = Reference.GetValue(value) as ICallable; if (func == null) { throw new TypeException(); } if (args != null && args.Length > 0) { for (int i = 0; i < args.Length; i++) { args[i] = Reference.GetValue(args[i]); } } var reference = value as Reference; if (reference != null) { if (reference.IsProperty) { return func.Call(reference.Value, args); } else { return func.Call(((EnviromentRecord)reference.Value).ImplicitThisValue(), args); } } return func.Call(Undefined.Value, args); } public object Call(object thisObject, object[] arguments) { var lexicalEnviroment = Scope.NewDeclarativeEnviroment(); var variableEnviroment = Scope.NewDeclarativeEnviroment(); var thisBinding = thisObject ?? Engine.GlobalEnviroment.GlobalObject; var newContext = new ExecutionContext(Engine, lexicalEnviroment, variableEnviroment, thisBinding); Engine.EnterContext(newContext); var result = Function.Value(newContext, arguments); Engine.LeaveContext(); return result; }

    Read the article

  • What's wrong with JavaScript

    - by ts01
    There is a lot of buzz around Dart recently, often questioning Google motivations and utility of Dart as replacement for JavaScript. I was searching for rationale of creating Dart rather than investing more effort in ECMAScript. In well known leaked mail its author is saying that Javascript has historical baggage that cannot be solved without a clean break. But there is only one concrete example given (apart of performance concerns) of "fundamental language problems", which is an existence of a single Number primitive So, my questions are: How an existence of a single Number primitive can be a "fundamental problem"? Are there other known "fundamental problems" in JavaScript?

    Read the article

  • Paren-free PHP? [on hold]

    - by Ivan Curdinjakovic
    I stumbled upon the idea for paren-free ecmascript (https://brendaneich.com/2010/11/paren-free/), which is inspired by Go language. And it's simple, clean and cool - if you make braces required instead of recommended (and they are recommended everywhere anyway: http://www.php-fig.org/psr/psr-2/), then parenthesis are unneeded around control structure “heads”. It would work exactly the same in PHP. So, a piece of PHP code could look like this: if $someVar == 42 { doSomething(); } or: foreach $someArray as $key => $value { echo "$key: $value"; } It's a small, but nice step towards a nicer, cleaner syntax and removing unnecessary parts. The question is - would PHP community be willing to see the languange move in that direction? Would it be considered an improvement by majority, or are we too used to typing those parenthesis and unwilling to see any change in PHP syntax?

    Read the article

  • What do you think of this generator syntax?

    - by ChaosPandion
    I've been working on an ECMAScript dialect for quite some time now and have reached a point where I am comfortable adding new language features. I would love to hear some thoughts and suggestions on the syntax. Example generator { yield 1; yield 2; yield 3; if (true) { yield break; } yield continue generator { yield 4; yield 5; yield 6; }; } Syntax GeneratorExpression:     generator  {  GeneratorBody  } GeneratorBody:     GeneratorStatementsopt GeneratorStatements:     StatementListopt GeneratorStatement GeneratorStatementsopt GeneratorStatement:     YieldStatement     YieldBreakStatement     YieldContinueStatement YieldStatement:     yield  Expression  ; YieldBreakStatement:     yield  break  ; YieldContinueStatement:     yield  continue  Expression  ; Semantics The YieldBreakStatement allows you to end iteration early. This helps avoid deeply indented code. You'll be able to write something like this: generator { yield something1(); if (condition1 && condition2) yield break; yield something2(); if (condition3 && condition4) yield break; yield something3(); } instead of: generator { yield something1(); if (!condition1 && !condition2) { yield something2(); if (!condition3 && !condition4) { yield something3(); } } } The YieldContinueStatement allows you to combine generators: function generateNumbers(start) { return generator { yield 1 + start; yield 2 + start; yield 3 + start; if (start < 100) { yield continue generateNumbers(start + 1); } }; }

    Read the article

  • What do you think of this iterator syntax?

    - by ChaosPandion
    I've been working on an ECMAScript dialect for quite some time now and have reached a point where I am comfortable adding new language features. I would love to hear some thoughts and suggestions on the syntax. Example iterator Numbers { yield 1; yield 2; yield 3; if (true) { yield break; } yield continue iterator { yield 4; yield 5; yield 6; }; } Syntax IteratorDeclaration:     iterator  Identifier  {  IteratorBody  } IteratorExpression:     iterator  Identifieropt  {  IteratorBody  } IteratorBody:     IteratorStatementsopt IteratorStatements:     IteratorStatement IteratorStatementsopt IteratorStatement:     Statement but not one of BreakStatement ContinueStatement ReturnStatement     YieldStatement     YieldBreakStatement     YieldContinueStatement YieldStatement:     yield  Expression  ; YieldBreakStatement:     yield  break  ; YieldContinueStatement:     yield  continue  Expression  ;

    Read the article

  • Confused with ECMAScript Language Specification Function Calls section

    - by Ding
    Hi, I am reading ECMAScript Language Specification Function Calls section Can someone rephrase or detailed explains the following sentense for me? The production CallExpression : MemberExpression Arguments is evaluated as follows: Evaluate MemberExpression. let's take this code as an example. var john = { name: 'John', greet: function(person) { alert("Hi " + person + ", my name is " + this.name); } }; john.greet("Mark"); Take above code as an example, what does production CallExpression mean? what is MemberExpression in this case, john.greet? Thanks!

    Read the article

  • SharePoint ECMAScript: Web.DoesUserHavePermissions()

    - by Donaldinio
    I am trying to determine the permission level of the current user using the ECMAScript client OM. The following code always returns 0. Any thoughts? function Initialize() { clientContext = new SP.ClientContext.get_current(); web = clientContext.get_web(); clientContext.load(web); clientContext.executeQueryAsync(Function.createDelegate(this, this.onSiteLoadSuccess), Function.createDelegate(this, this.onQueryFailed)); } function isUserWebAdmin() { var permissionMask = null; permissionMask = new SP.BasePermissions(); permissionMask.set(SP.PermissionKind.manageWeb); var result = new SP.BooleanResult(); result = web.doesUserHavePermissions(permissionMask); alert(result.get_value()) }

    Read the article

  • What is JavaScript, really?

    - by Lord Loh.
    All this started when I was looking for a way to test my webpage for JavaScript conformance like the W3C HTML Validator. I have not found one yet. So let me know if you know of any... I looked for the official JavaScript page and find ECMA Script. These people have standardized a scripting language (I do not feel like calling it JavaScript anymore!) and called it ECMA-262 (Wikipedia). Their latest work is Edition 5.1 JavaScript was developed my Mozilla Corporation and their last stable version is 1.8.5 (see this) which is based on the ECMA's edition 5.1 The Wikipedia page linked mentions dialects. Mozilla's JavaScript 1.8.5 is listed as a dialect along with JScript 9 (IE) and JavaScript (Chrome's V8[Wiki]) and a lot others. Am I to understand that JavaScript 1.8.5 is a derivative of the ECMA-262 and SpiderMonkey[Wiki] is an engine that runs it? And Chrome has its own dialect and V8 engine is the program that runs it? With all these dialects based off ECMA-262, what I can no longer understand is "What is JavaScript"? Are there any truly cross browser scripting languages? Do the various implementers come together to agree on the dialect cross compatibility? Is this effort ECMA?

    Read the article

  • Ecmascript 5 Date.parse for ISO 8601 test cases

    - by 4esn0k
    What results is right for next test cases? //Chrome Opera Firefox IE 9 Safari console.log(Date.parse("2012-11-31T23:59:59.000Z"));//1354406399000 NaN NaN 1354406399000 NaN console.log(Date.parse("2012-12-31T23:59:59.000Z"));//1356998399000 1356998399000 1356998399000 1356998399000 1356998399000 console.log(Date.parse("2012-12-31T23:59:60.000Z"));//NaN NaN NaN NaN 1356998400000 console.log(Date.parse("2012-04-04T05:02:02.170Z"));//1333515722170 1333515722170 1333515722170 1333515722170 1333515722170 console.log(Date.parse("2012-04-04T24:00:00.000Z"));//NaN 1333584000000 1333584000000 1333584000000 1333584000000 console.log(Date.parse("2012-04-04T24:00:00.500Z"));//NaN NaN 1333584000500 1333584000500 NaN

    Read the article

  • Recommended Reading for Polishing JavaScript coding style?

    - by wml653
    I've been coding in JavaScript for a while now and am fairly familiar with some of the more advanced coding features of the language (closures, self-executing functions, etc). So my question is, what advanced books/blogs/or anything else would be recommended to help tighten up my coding style? For example, recently I was coding something similar to: var x = ['a', 'b', 'c']; var exists = false; for(var i = 0; i < x.length; i++){ exists = x[i] === 'b' ? true : exists; } But found that the following condensed code would work better: var y = {'a':'', 'b':'', 'c':''}; var exists = 'b' in y; Both store the same value in 'exists', but the second is less common, but much cleaner. Any suggestions for where I should go to learn more tricks like this?

    Read the article

  • Why is JavaScript not used for classical application development (compiled software)?

    - by Jose Faeti
    During my years of web development with JavaScript, I come to the conclusion that it's an incredible powerful language, and you can do amazing things with it. It offers a rich set of features, like: Dynamic typing First-class functions Nested functions Closures Functions as methods Functions as Object constructors Prototype-based Objects-based (almost everything is an object) Regex Array and Object literals It seems to me that almost everything can be achieved with this kind of language, you can also emulate OO programming, since it provides great freedom and many different coding styles. With more software-oriented custom functionalities (I/O, FileSystem, Input devices, etc.) I think it will be great to develop applications with. Though, as far as I know, it's only used in web development or in existing softwares as a scripting language only. Only recently, maybe thanks to the V8 Engine, it's been used more for other kind of tasks (see node.js for example). Why until now it's only be relegated only to web development? What is keeping it away from software development?

    Read the article

1 2 3 4  | Next Page >