package keyword reserved?
What use cases does this solve?
Jonathan Bond-Caron wrote:
What’s the history of the unused keyword “package”, is it from Java?
In 1995, I reserved all the Java (JDK1.0 era) reserved identifiers.
ES1 kept them, but ES5 cut way back, yet kept 'package' among others as reserved in strict code. No one had a championed proposal for 'package', though. It was reserved along with others because "it seemed like a better idea than unreserving".
Please don't rush to contrive a use for 'package' without a use-case.
On Fri Apr 11 05:25 PM, Domenic Denicola wrote:
What use cases does this solve?
Struggling with Typescript's mixed module definition.
a) module name {}
Or
b) module "name" {}
Painful to make a decision about either syntax, started with (a) which isn't Ecma :/
What use cases does this solve for JavaScript, not TypeScript?
Not sure, benefit comes down to subjective preference. Keeps the single 'module' per file pattern from node.js
Is it safe to use the 'package' keyword then, no proposals for using it?
On Fri, Apr 11, 2014 at 6:23 PM, Jonathan Bond-Caron <jbondc at gdesolutions.com> wrote:
Keeps the single 'module' per file pattern from node.js
This is already the case for ES6 modules, without eating up another reserved word.
Jonathan Bond-Caron wrote:
Is it safe to use the 'package' keyword then, no proposals for using it?
You mean for some other language compiled to JS to use 'package'? If so, then no: it's unsafe, explicitly so. The 'package' identifier is a strict future reserved word. Steer clear, the TC39 standards body may yet define it.
What's the history of the unused keyword "package", is it from Java?
Been thinking about this lately, could an external module be called a package?
Some thoughts: