ecmascript-harmony

Is there any current proposal I can follow about adding proper locale support to JavaScript?

故事扮演 提交于 2019-12-07 16:38:40
问题 Even though all major operating systems and programming languages/APIs have had locale support for at least a couple of decades, it seems that JavaScript still does not! With JavaScript becoming more and more of a full application programming language both in the browser and on the server, the lack of real locale support is becoming a real problem. Are there any proposals to add locale support as it exists in other languages to the EcmaScript standard? As part of the "harmony" project or

How to enable harmony in Coffeescript?

好久不见. 提交于 2019-12-07 02:29:00
问题 Here is how I run my js code: node --harmony ./data/app.js Now I want to move to the CoffeeScript. So I try to run it like that: coffee ./data/app.coffee And it fails. How can I pass this --harmony option? 回答1: To pass args through, you can use the --nodejs argument: coffee --nodejs --harmony ./data/app.coffee 来源: https://stackoverflow.com/questions/13548196/how-to-enable-harmony-in-coffeescript

When will ES6 be available in IE? [closed]

[亡魂溺海] 提交于 2019-12-06 18:44:45
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . This is a legitimate question if you really know the answer or can provide some information. Firefox and Chrome are continually

Restructuring TypeScript internal modules to external modules

梦想与她 提交于 2019-12-06 04:07:17
I have a website that uses a large typescript code base. All clases as in their own files, and wrapped with an internal module like so: file BaseClass.ts module my.module { export class BaseClass { } } file ChildClass.ts module my.module { export ChildClass extends my.module.BaseClass { } } All file are included globally with script tags, in the appropriate order (using ASP.NET Bundling). I would like to move to a more modern setup and use webpack. I would like my module syntax to use whatever the new ECMASCRIPT module standard is. But there is much code using the existing "module namespaces"

Is there any current proposal I can follow about adding proper locale support to JavaScript?

☆樱花仙子☆ 提交于 2019-12-06 03:08:30
Even though all major operating systems and programming languages/APIs have had locale support for at least a couple of decades, it seems that JavaScript still does not! With JavaScript becoming more and more of a full application programming language both in the browser and on the server, the lack of real locale support is becoming a real problem. Are there any proposals to add locale support as it exists in other languages to the EcmaScript standard? As part of the "harmony" project or anywhere else? I'd like to support and evangelize any such proposal. (This is a followup to my previous

Garbage-collected cache via Javascript WeakMaps

梦想的初衷 提交于 2019-12-05 19:12:33
问题 I want to cache large objects in JS. These objects are retrieved by key, and it makes sense to cache them. But they won't fit in memory all at once, so I want them to be garbage collected if needed - the GC obviously knows better. It is pretty trivial to make such a cache using WeakReference or WeakValueDictionary found in other languages, but in ES6 we have WeakMap instead, where keys are weak. So, is it possible to make something like a WeakReference or make garbage-collected caches from

`this` in global scope in ECMAScript 6

烂漫一生 提交于 2019-12-05 12:16:57
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? Also, 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

How to add --harmony node flag to grunt-express

大城市里の小女人 提交于 2019-12-05 10:15:26
I'm using grunt-express to do local development. here is my GruntFile.js var path = require('path'); module.exports = function(grunt){ grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), uglify:{ options:{ banner:'/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' } }, express:{ server:{ options:{ debug:true, server: path.resolve('app.js') } } }, env : { options:{ }, dev : { NODE_ENV : 'development' }, prod : { NODE_ENV : 'production' } }, mochaTest:{ test:{ options:{ reporter:'spec' }, src:['tests/*.js'] } } }); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt

Access [[NativeBrand]] / [[Class]] in ES6 (ECMAScript 6)

落爺英雄遲暮 提交于 2019-12-05 05:39:31
I was reading over the draft for ES6, and I noticed this note in the Object.prototype.toString section: Historically, this function was occasionally used to access the string value of the [[Class]] internal property that was used in previous editions of this specification as a nominal type tag for various built-in objects. This definition of toString preserves the ability to use it as a reliable test for those specific kinds of built-in objects but it does not provide a reliable type testing mechanism for other kinds of built-in or program defined objects. From reading this thread on es

Ecmascript 6 support on Node.js

人走茶凉 提交于 2019-12-04 10:41:54
问题 I've been working with KoaJS for a while, and we can easily use the 'let' keyword and the generators when using the --harmony flag but I couldn't find how much support for does the node v0.11.x provides while using the same. I tried using the default value argument initialization but couldn't succeed. Is there any source available which can list the no of features of ECS 6 supported in node v0.11.x using the harmony flag? Or if there is any npm module available for node that might allow me to