jQuery Core Team Meeting – Feb 15 2013

February 12, 2013
Minutes (Notes) of the meeting of jQuery
Location: #jquery-meeting on Freenode
Attending: DaveMethvin, rwaldron, orkel, gibson042, siovene, timmywil
Time: Noon ET

Official Agenda:

Siovene update/discussion on perf

  • Still looking for ideas on organization, tests, etc

jQuery 2.0b2

  • This week – Day?
  • Stuff to be done before it ships? No

Things still needed for 2.0 final

Optional qSA/mS Sizzle stub

jQuery Migrate 1.1.1 late this week — Dave

Todos marked in Github issue tracker:

jQuery 1.9.2 — I think we can wait a couple of weeks

Version/feature correspondence (from last week)

  • Make 1.10 track 2.0? (So 1.11->2.1, 1.12->2.2, etc)
  • in next major point release, don’t execute scripts by default
  • Let’s leave this an open issue until we know what might need to be in each version

bugs.jquery.com

  • New home page to improve people’s reporting
  • e.g., docs issues go to api.jquery.com

Open tickets triage

http://bugs.jquery.com/ticket/13428

  • Lets hold off on action for now, potentially document that native events should not depend on using trigger data and use .triggerHandler if you need to pass data

http://bugs.jquery.com/ticket/13393

http://bugs.jquery.com/query?status=new&report=505&order=priority

jQuery Mobile Team Meeting – Feb 14 2013

  • Attending: Todd Parker, John Bender, Jasper de Groot, Jason D Scott, Anne-Gaelle Colom, Gabriel Schulhof, Alex Schmitz, Ghislain Seguin

link Todd

  • 1.3.0 Final release still on track on Monday the 18th, blog post draft is roughed out
  • New API docs and demos will launch on the same day
  • Nested listviews will be depreciated with 1.3.0
  • IE7 issue with multipage docs - browser bug we can’t work around, noting this issue in the docs

link John Bender

  • Navigation odditiies
  • Perf suite setup
  • Chatted with someone at Intel about their attempt to do the same for jquery

link Jasper de Groot

  • worked on demos, will finish a few more demos today/tomorrow
  • disabling AJAX global in demos breaks view source
  • added some things to 1.4 planning / roadmap

link Anne-Gaelle Colom

  • learned how to tag
  • reviewing api docs for errors/mistakes and links that need to be removed or fixed

link Gabriel Schulhof

link Ghislain Seguin

  • Working on the release script, making it part of grunt and will share back with core
  • Working with Rafael on sharing code with UI for the download builder. No real progress there besides a repo move.

link Alexander Schmitz

  • finished h2widget
  • working on demos for h2widget and deeplinking
  • fixed broken link issue in glbal nav panel
  • working on update to readme to explain php include for nav panel
  • more faq’s trying to finish section before monday (over half way there)

jQuery Core Team Meeting – Feb 11 2013

Attending: DaveMethvin, rwaldron, orkel, gibson042, siovene, timmywil

link Siovene update/discussion on perf

  • Still looking for ideas on organization, tests, etc

link jQuery 2.0b2

link jQuery Migrate 1.1.1 late this week -- Dave

link jQuery 1.9.2

  • I think we can wait a couple of weeks

link Version/feature correspondence (from last week)

  • Make 1.10 track 2.0? (So 1.11->2.1, 1.12->2.2, etc)
    • in next major point release, don't execute scripts by default
    • Let's leave this an open issue until we know what might need to be in each version

link Open tickets triage

  • Lets hold off on action for now, potentially document that native events should not depend on using trigger data and use .triggerHandler if you need to pass data

jQuery Mobile Team Meeting – Feb 07 2013

  • Attending: Todd Parker, John Bender, Jasper de Groot, Jason D Scott, Anne-Gaelle Colom, Gabriel Schulhof, Alex Schmitz, Ghislain Seguin

link Todd

  • 1.3.0 RC1 went out on Monday as scheduled, targeting Monday the 18th for final
  • http://jquerymobile.com/blog/2013/02/04/jquery-mobile-1-3-0-rc1-released/
  • We’ve had two issues come in that needed to be fixed for final:
    • 5593 - hidden form elements that were added for focus management in popups were being added in other situations. Fixed in master
    • 5588 - Panels: Make sure active state is applied to and removed from buttons in header too. Fixed in master.
  • 1.1.2 and 1.2.1 maintenance releases coming within the next week or so. Changelogs done, need to update the docs and deploy. Since it’s a small release, we’re not doing an RC which is what core has switched to doing.
  • Initial planning for 1.4.0 has started. Alex is working with Scott Gonzalez on re-factoring core.js to be aligned with jQuery UI as the first step.
  • The plan is delete the old docs and replace it with the new API site and a companion demos site site. Working to make this switch for 1.3.
  • Working on migration plan for our servers
    • jquerymobile.com/test/ will be mapped to view.jquerymobile.com/master/demos.
    • jquerymobile.com/branches/ will now be view.jquerymobile.com/branchname
  • New shelves and charging setup in the Boston test lab. Added a Microsoft Surface this week.

link John Bender

  • base tag branch revived, basic testing
  • navigation demos

link Jasper de Groot

link Anne-Gaelle Colom

link Gabriel Schulhof

link Ghislain Seguin

  • Was off most of the week.
  • Continuing progress on grunt migration
  • Had a meeting with Rafael about the common code for UI/Mobile download builder. At first it will just generate the UI. Then it could have an interface that both projects would implement differently to talk to their respective servers.

link Alexander Schmitz

  • Wrote all FAQs in the Page section
  • Made deep links for docs until we can merge real fix after 1.3
  • Working on h2 widget to auto-populate the “In this section” panels for the new demos
  • Talked with scott_gonzalez on bringing in ui core
  • Started initial work planning
  • Worked with gnarf and ryanneufeld on 502 and view idea

jQuery Core Team Meeting – Feb 06 2013

February 4, 2013
Minutes (Notes) of the meeting of jQuery
Location: #jquery-meeting on Freenode
Attending: DaveMethvin, rwaldron, timmywil, gibson042, mikesherov, jaubourg, orkel
Time: Noon ET

Official Agenda:

jQuery 1.9.1

TODAY

TestSwarm isn’t working AT ALL right now (natch)

Any other changes to be landed?

jQuery Migrate 1.1.0

  • May need a 1.1.1 to remove “use strict” there too

Build issues

grunt working well enough to wait for 0.4.0 final

still need to restore compare-size

stupid sourceMappingURL location issue

Need to check our build code when we upgrade Uglify:

Swarm failures

  • Seeing focus issues on Firefox, need to double-check

jQuery 2.0 beta2

Thursday?

should have a beta to let people exercise changes to .data()

  • Rick is working on performance optimizations for .data()

Benchmarks

Version/feature correspondence

  • Make 1.10 track 2.0? (So 1.11->2.1, 1.12->2.2, etc)
  • in next major point release, don’t execute scripts by default

Open tickets triage

jQuery Mobile Team Meeting – Jan 31 2013

  • Attending: Todd Parker, John Bender, Jasper de Groot, Anne-Gaelle Colom, Gabriel Schulhof, Alex Schmitz, Ghislain Seguin

link Todd

  • 1.3.0 RC1 - Targeting Monday, just a few open issues we’re looking at
  • 1.3.0 Final - Targeting mid-February
  • API docs are almost 100% complete
  • Been focusing on creating widget pages for the new demo site, 70% of widgets are filled in, work starting on Q&A, demos have been cleaned up. Aiming to launch those with 1.3 final
  • Initial planning for 1.4 has started in the wiki
  • Ralph and Anne have been working on the new site and blog
  • Re-worked all the icon sprites for 1.3 to be consistent across sizes/colors. Added icon demos for how to remove the disc and use the black sprite
  • WP7.8 device donations from Microsoft have come in, starting to distribute these out
  • RIM sent two BB10 test devices for the Boston lab, under NDA
  • Working with Xavier on download builder and ThemeRoller support and future upgrades, shared tooling with UI

link John Bender

  • Worked with arschmitz a bit on nav with anchors
  • Fixed the test build for phantom 1.8, released grunt-junit 0.1.6

link Jasper de Groot

link Anne-Gaelle Colom

link Gabriel Schulhof

link Ghislain Seguin

  • Talked with Ralph about where the download builder would fit in the new website, we decided to make it should be part of it
  • grunt, grunt, grunt! What’s working:
    • JS build with minification and sourcemap (yay!)
    • CSS consolidation and minification
    • Copy of images
    • Zipping -> dist/jquery.mobile.zip
    • Testing via QUnit/PhantomJS with XML reports output for CI
    • Testing against any version of jQuery via --jquery flag (will rename to --jqueries) ie --jquery=1.7.3,1.8.0,git
    • Added ability to run a subset of suites via --units flag (will rename to --suites) ie --units=event,navigation
    • Found a way to work around the PHP dependency for tests which means no more apache/php needed. The simple connect http server that comes built-in with grunt is enough. I’ve added a middleware to the connect server which intercepts request for /js/ and returns the built bundle. It also validates that our built jquery.mobile.js is working.
  • There are now 2 kinds of builds:
    • grunt dist and grunt dist:release the :release flag will pick up the version from the package.json as opposed to the git SHA1 hash.
  • Left to do:
    • 2 main suite failures left that I might need help with:
      • tests/unit/navigation/sequence/sequence-push-state-disabled-dialog-hash-key-tests.html
      • tests/unit/navigation/sequence/sequence-push-state-disabled-tests.html
      • leading to: 38/775 assertions failed (399454ms)
    • deploy
    • add a flag for theming
    • cleanup target
    • testswarm
    • anything else?

link Alexander Schmitz

  • worked with john bender on nav came up with game plan to add
    • ability to pash hashes to pages
    • ability to deeplink to id’s
    • ability to manipulate the hash without adding history entries (push state only)
    • as a way to auto open panels and popups should linking to a url with a hash for a panel or popup open it?
  • started nav work
  • added faq pages (all of them in the forms category are complete now)
  • 1.4 planning with todd and Gabriel
  • worked with todd to come up with plan for AJAX in the docs
  • triage and bugs

Ecma/TC39 Meeting – Jan 31 2013

link January 31 2013 Meeting Notes

John Neumann (JN), Allen Wirfs-Brock (AWB), Rick Waldron (RW), Waldemar Horwat (WH), Eric Ferraiuolo (EF), Erik Arvidsson (EA), Luke Hoban (LH), Matt Sweeney (MS), Doug Crockford (DC), Yehuda Katz (YK), Andreas Rossberg (ARB), Sam Tobin-Hochstadt (STH), Brendan Eich (BE),

link 4.14 Module Update

(Presented by Sam Tobin-Hochstadt) TODO: Request Slides

STH: (Slide 1)

Recap from November

  • Modules no longer named by Identifiers.
1
2
3
4
module "m" {
import "x/y" as y;
export y;
}

DC: Are they strings?

STH: They are string literals, but may have an internal structure. We should allow characters that don't have to be escaped in URLs.

LH: This is something we will definitely have to specify.

STH: Confirms that they are string literals.

DC: Why strings and not Identifiers?

STH: The string indicates a different scoping behavior

MM: Nesting example?

STH: (Slide 2)

Nested Modules

1
2
3
4
5
6
7
8
module "outer" {
let y = 1; // not exported
module "inner" {
let z = y + 1;
export z;
}
}
import {z} from "outer/inner";

MM: Why isn't "inner" exported?

YK: All modules are visible/available.

MM: Why are all modules visible?

Concern about export visibility.

STH: You're both actually in agreement

LH: There was a change from a more complex system, now when you write something inline, it's loaded into the internal loader registry. This simplifies the proposal, removing the "hybrid" behavior of an Identifier.

STH: Believe this is a better design.

ARB: Disagree.

MM: Q. Where the "inner" string appears, there is no way to change the nesting path.

ARB: ...

MM:

AWB: When you do an import, is that passed through the Loader?

STH: Yes.

AWB: So you could write a Loader that blocked "inner"?

STH: You could enforce any arbitrary rules in the Loader.

ARB: What happens if inside "outer", I have "import from inner"?

STH: Won't work. There is a ...

EA: What happens if you do "import {a} from outer"?

STH: Don't understand.

STH: Important both have a mechanism for top level and relative,

ARB: Appears to be reinventing half of lexical scoping in an ad-hoc way, super-imposed on strings. When somebody thinks to have a better system than lexical scoping, they usually turn out to be wrong.

STH: Trying to avoid this being like lexical scoping. The goal is to be explicitly different, closer to Node... refers to require()

YK: There is a large data set supporting

LH:

YK: Mentions concatenation argument, determined as not strong enough.

STH: ...gave an example of a module that may want nested modules...?

YK: Predict it to be multiple files, not sub modules within a module

STH/YK: If you have a top level...

AWB: clarify? you can't take two top level modules, concatenate them and put them in a script tag?

STH: Yes, but you can't import from them.

LH: Clarifies.

AWB: There isn't a transformation that would take all of the modules and concat into a single file and it would mean the same thing?

STH: You could certainly write a transformation, but you would have to put that result into something that

ARB: What if I import inner, but outer hasn't been imported yet?

STH: Outer is implicitly loaded.

...

YK: I previously understood the module system (STH: I thought it was EA who said this)

LH: I thought... There is a loader that has a table of things. Two ways to get them in there:

  1. Filesystem, where keys are the path
  2. Load a script

Are you saying that the file name is now unnecessary?

STH: Yes

LH: I don't see how you could make this work

YK: I think it's not good. You can't dictate that file A must be here for file B to work.

AWB: You don't want to mix physical identifiers with logical identifiers

ARB: Exactly

STH: One of the other ideas is that the Loader has setters, so that we can replace them... allowing you to change the default Loader. We are going to provide the basic programmatic layer, not design the declarative loader mapping mechanism.

YK: The requirement, based on the example: "jquery-ui" needs "jquery" ...will be problematic when a developer cannot control where the files go.

MM: Will inner be executed?

STH: inner is not executed unless imported.

MM: is the identifier after the module keyword required?

STH: the semantics would likely involve immediate import of that module.

LH: I don't understand why we want nested modules like this. There is no existing system that supports the need.

YK: Agree.

STH: (whiteboard)

1
import {$} from "jquery"

What does "jquery.js" look like?

YK: Top level $ with no "module {}"

STH: What if that file wants to use some other module? I think people will get that very wrong.

AWB: (Concern about the physical file and the import) Not operating logically at the same level as modules

EF: Agrees.

...Discussion regarding "loading" the physical and "importing" the logical.

LH: What Sam is saying... "why can't it just be the import syntax"

MM: Given a fully qualified path and module name, that uniquely identifies a module?

STH: Yes.

MM: What does TypeScript do?

LH: TypeScript has two notions of modules. "declarative object", similar to the earlier module proposal. Also has "file modules" that is a file with "module" that becomes an AMD define.

ARB/LH: Discussion of the semantics of the TypeScript type system.

STH: It assumes that all of the bindings are there for all time.

LH: Yes.

STH: I will avoid "possible futures". To re-answer, module sources are contiguous.

...

STH: Originally, Dave and I punted on nested modules, until we ran into a case that needs nested modules.

ARB: The result is a reinvention of lexical scoping of sorts.

...

AWB: Imagine you had a module named "." and you had a module in the same file named "./util" and so on... Then you take that and put it in a file named "jquery" and try to import from "."...

STH: What that suggests is that naming something "." will give strange behavior.

AWB: It represents an example of the problem you're against.

EA: If you import a file, called "jquery" and that has a nested module named "util", should work the same if "util" is just in the same directory.

Mixed discussion, re: what could be solutions of

STH: Recapping... Yehuda and Erik brought up a concern about defining multiple top level modules and how to indicate that they are belong at the top level.

YK: another example, Ember relies on Handlebars...

STH: (whiteboard)

Solution?

1
2
3
4
module "/jquery" {
}
.
.

LH: One of the things the module system needs, to move forward, there should be 5-10 real world scenarios. Each scenario needs to be met and recorded, each time a change is made, it needs to be applied to each scenario to ensure that we're covering the needs.

AWB/YK/RW: Strongly agree.

STH: Scenarios

  1. Script tag, local file
  2. Script tag, cdn
  3. Inline

AWB: An over simplification

EF: Will always need to provide some kind of configuration, because in reality, files and libs have relevant version numbers.

YK: ...gives example for RSVP, Ember, Metamorph

EF: It should be clear how you link this name to a resource.

STH: Should be able to set up a loader initially and then "import" just works.

YK/STH: But we're not going to define the mechanism, because it's out of scope.

STH: Do you all understand why I don't think this committee should design a complete API for Loader?

EF: But it results in magic and Allen is talking about removing the magic.

STH: But that's configurable

EF: Configuring is not pleasant.

STH: System.fetch(...url)?

EF: Imagine if jQuery home page said: System.fetch(jquery); import {$} from jquery.

YK: We want a programmatic hook, but I want to say "import jquery" and I want to tell you where it is.

STH: This is easy to add, but I'm not sold. I will discuss this with Dave

YK: Is because you don't see the burden?

...The current proposal won't work when you want to use a CDN url and also have jQuery at the top level.

The primary issue:

1
import { jQuery } from "jquery";

Needs to have some mechanism by which we can configure WHERE "jquery" is, via URL.

STH: A possible solution?

1
2
3
Loader.configure([
[ "jquery", "file.js" ]
]);

EF: The original proposal, where the file is inferred by the name doesn't get us close to meeting the need.

BE: This is not design by committee, we really need user testing.

AWB: Are there people that are going to provide the specific scenarios that need to be met?

YK/EF/RW: (agree to work with Same and Dave)

STH: (slide 3)

Dropped Features

  • export =
  • export get/set

LH: Reminder to include the node use case in the scenario write ups.

STH: (slide 4)

Loader Semantics

  • import foo/bar => fetches "foo/bar.js"
  • import ./foo => relative to the file
  • WIP, specifying the details of loading
    • Ordering
    • Error
    • Hooks
  • New "rewrite" hook

EA: Q. re #1, relative to what?

STH/YK: document, document base

ARB: Are you sure about "relative to file" on the second?

YK: This would break concatenation

STH: Important for self-containment

YK: The Loader has to know enough about the system to find the correct thing

Mixed discussion.

LH: We need to drive this through with concrete examples and use those steer the development here. I don't think we're going to get anywhere here today.

STH: (returning to the slide) Specified the "rewrite" hook to see that you want jQuery, it will fetch the source, eval it and then rewrite into jQuery.

DC: ...Recalling the original discussion around modules and the agreement he made with Dave to withhold objection on the grounds that we'd agree with syntax later. That agreement hasn't been met. The discussion we had this morning indicates that it has failed to meet the requirements and should not hold up the rest of the specification. Suggest to remove from ES6

LH: As much as it would be great to deliver this, it's simply not ready and not nearly developed or concrete enough to continue forward with. We'd need a year to user test to get the best results from the feature. Need to understand and meet the needs.

BE: Library code can't dictate and may have to change, but that shouldn't block the feature.

STH: It's unfair to drop the feature when other features have behaved the same way and are still incomplete.

MM: To be fair, changes coming to proxy

STH: There is a great deal of completed work for this and with valuable feedback, we can still deliver. It's not fair to say "We're providing you with feedback, therefore you're not done".

BE: Yes, we need algorithms in the spec and user testing in time.

EA: Modules are the most important feature that we have to ship, but I agree with Doug that it might not be in time.

BE: One option is to move it to ES7

EA: From implementation, modules is the highest priority, but there is nothing to implement.

AWB: And much of the spec will rely on modules.

MM: Comparisons of the lexical scoped modules and the new string name modules

BE: ...Recalls the argument from 3 years ago. Notes that IIFE is NOT what module {} is and cannot be compared.

DC: I've spent years promoting this, but I can't see how it will make it.

AWB: We should aim for a "maximally minimal modules" proposal, that we can then move forward with to be successful.

WH: I like modules but also share Doug's skepticism about them being ready for ES6

ARB: I've been working on implementing modules for a year now and the changes you made in November invalidated most of that work, and they were not changes that I could agree with.

STH: To Clarify, we should not do a design along these lines AND you're concerned about the schedule.

ARB/AWB: Don't want to go back to ground zero.

LH: Start with a more robust design exercise, instead of trying to patch.

YK: To address the notion that the need has eroded, the systems that have been developed have actually put us in a worse position.

EA: Can we get champions of an alternate proposal? Andreas?

AWB: If we're going to defer or decouple modules from ES6, we need to know sooner, by the next meeting.

STH: I believe strongly that the state of the module system is being mis-perceived.

EA: I'm really confused by the current system and I feel like i used to understand the old module proposal well.

ARB: Same here.

LH: I don't think the current system is grounded or addresses the real problems that it needs to address. ...What we need to accomplish is much deeper. ...Prior art and experience dictates how the experience will be received and this doesn't seem to come up.

YK: I see modules as largely "desugaring" to two things that can be done with defining and loading in AMD, YUI etc.

LH: I'm not seeing all of the needs being met. My intuition is to say "this is a sugar for AMD", I think that could be a solid guiding principle.

YK: I agree that it's easier to see a path forward if it's largely the same thing as something that is already in use.

STH: re: possibly maximally minimal? There are too many details and requirements that are closer to surface, syntactically. It's harder to jettison the complicated parts to reduce the work, but also gives me confidence that the fundamental design is not changing as much as those in the room may belief. ...It aligned the programming model with the semantics of the Loader ...Believe it would be a big mistake not to do modules in ES6. ...Problematic that we're having this discussion without Dave present.

RW: We should break and table this until Dave can be present.

LH/DC/STH: Agree.

AWB: Concerned that we're on a path that won't include modules. If we're going to ship within a year of our target, modules won't make it.

STH: If we characterize it that way, then not many features are ready.

AWB: Agree.

RW: We should table this until the next meeting, where we are scheduled to actually discuss which features move forward and which don't. Additionally, Dave will be present.

STH: Of course over the next two months, Dave and I will be working with Allen to move modules into the spec.

EA: That could be the best thing.

RW: Likely to restore confidence if this can be achieved.

LH: Not convinced we have a design that is ready for the spec.

...Seeing this in spec may reify the unknown parts.

YK: If we don't have modules in ES6, certain parts will have to be respec'ed

AWB: I also believe a maximally minimal specification that can be used internally could happen.

LH: Of course, there is a status quo: Creating global names that define built ins

...Discussion re: Map, Set and WeakMap already in browsers.

JN: Steering to break. The point of record...

link Conclusion/Resolution

  • Cannot continue this discussion without Dave Herman
  • Continue work, the understanding the next meeting is decision time.
  • Work with committee members and community to develop concrete scenarios that must be met and addressed.

link New Scope of the Royalty-Free Task Group (TC39TG1)

...Discussion...

WH: Motion

MM: Seconded

DC: Seconded

link Conclusion/Resolution

We approve the new scope for RFTG Unanimously.

There was no specific agenda item here

ATTENTION: Mark, Waldemar, Allen... Please review these notes. I tried to keep up, but I'm not confident in the record.

MM: Want to maintain the option to defer Notification Proxies and Private Symbols—Defer to March?

...Mixed discussion about feature deferment.

WH: I agreed to classes based on private names inclusion, if there are no private names, then I can't agree to classes.

AWB: The objections have all been based on their interaction with Proxies

MM: I disagree, but don't want to deep dive.

WH: This is a bug in Proxy

AWB: Agree.

MM: I'd like to postpone a larger discussion until March.

AWB: (whiteboard)

1
var p = Proxy(target, handler);

Any operation you do on "p" is forwarded onto "target"...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
var target = {
foo() {
if (someLookup(this)) {
}
}
};
target.foo();
p.foo();
// "this" in foo() is bound to the object
// SHOULD always be "target"
// EF: Could be multiple bindings for the same "target",
// so "this" should be "target"

AWB: Outlines issues with the MOP...

1
2
3
target.[[Get]]("foo");
P?
self.[[Get]]()

See image.

target has a method named foo, uses the "this" value,

(WH's summary) The point that Allen was demonstrating on the whiteboard was that, given:

1
2
var target = {foo() {if (someLookup(this)) {...}}};
var p = Proxy(target, {});

then: target.foo and p.foo are the same function object. target.foo() and p.foo() get different this values (target and p respectively).

Use cases:

  1. Virtual Object
  • The target is not really the target, just a book keeping mechanism.
  • Wouldn't need the target, despite need for invariant checks
  • Nearly all functionality in the handler
  1. Membranes (also, "nosuch...")

  2. Caretaker

  • Allows all through until revoked
  • Nearly all functionality in target

AWB: A virtual object case... the target object is a captive object of each proxy, part of the implementation. Providing most of the functionality. The target never escapes. ...The case that doesn't cover that: the a proxy is being over laid on a pre-existing object.

YK/AWB: The case of defining an array-behaving-length object via a proxy on DefineOwnProperty works well. WH: Is the pseudo-array example a virtual object or caretaker pattern? AWB: Virtual object WH: Why did you classify it that way? It's implemented almost entirely in the target, with but one method in the handler.

MM: target.foo() and p.foo() by themselves mean the same? Yes. Are these still being spec'ed as a Reference Type? (base and a value).

AWB: When you evaluate p.foo(), The [[Get]] operation returns ? The [[Invoke]] operation returns ?

(TODO: Ask Allen to revisit)

MM: [[Get]] value [[Get]] base

AWB: In the spec, it's handled as a single operation... A property access and then an invocation... we can separate

YK: This matches my misunderstanding.

AWB: We can trace this to Notification Proxies

MM: Recounts issues

Bookkeeping with invariant enforcement lead to exposure of the target.

YK: I want create a virtual object and you want to create a caretaker, might not be able to do both.

MM: Have to do both.

Issues with the current list of traps that can be resolved with the addition of a new trap that addresses... ?

AWB: Recommends a "call method" trap to resolve

WH: Still not sure what the motivation is. The behavior of target.foo() and p.foo() getting different this values (target and p respectively) seems correct. Turning function dispatch into a fundamental operation rather than a composite of a property lookup and call won't accomplish much. It would affect p.foo(), but wouldn't affect p.foo.call(p, ...), and I very much don't want to introduce another gratuitous asymmetry between the two.

MM: In the same way that [[Get]] was designed to make a decision, "Call Method"... (Mark, need clarification )

WH: Not specific to Call Method, but any case where you have self-referential object (i.e. any place where you do p.foo(..., p, ...)).

AWB: Anything that involves implicit "this"

AWB: If want to control what's passed through, you'd use a p.foo.call, otherwise you'd use a wrapped function.

MM: The default probably should be the proxy and not the target

1
2
var q = Object.create( p );
q.foo();

MM: When you're inheriting from the Proxy, q is a normal object, does it have the property foo? it does not, recursive get on p and will get the proxy, q is the receiver.

WH: Call Method becomes useless...

MM: [q.foo] does the right [[Get]], q.foo(); the value of "this" is q

...On the target, a getter for "foo", the handler trap is empty, uses the default, the getter function for "foo". What?

AWB: Unsure,

MM: The handler is given the ability to make a decision, same for Call Method. In the absence of a trap, what does the default do? The default case, "this" should be "q".

...The default, the getter should be invoked for "q.foo" case

AWB: ...Recalls discussion with Tom, re: [[Put]] creating properties on wrong objects.

STH: Resteer the discussion...

link Conclusion/Resolution

Continue discussion offline.

MM: What we did with hasInstance, we should audit all of the traps and determine if we can replace with @@methods.

AWB: Applied similar approach in the spec.

link Class extends: Throw on non-constructor?

In July, we discussed what would happen when:

1
2
3
class Foo extends Object.prototype {
}

The decision of record is: Throw on non-constructor.

AWB: You may have class who's instances inherit on the instance side, not the class side.

LH: classes just simplify the Constructor pattern, and we should keep it that way.

RW: Can't you get the same semantics by omitting the super() call?

LH: No, you'll still get class-side.

...Discussion comes back around to throwing on non-constructor. It will also allow for future extension points by relaxing the RHS of extends.

LH/EA/RW/WH: In agreement.

link Conclusion/Resolution

Class extends throws on non-constructor (extends null is still valid)

link Map/Set comparator

(Presented by Allen Wirfs-Brock)

Issue: Allow Map or Set to have a custom comparator for set, get, has, delete

  • Current constructor signature

    • Map(iterator=undefined)
    • Set(iterator=undefined)
  • Proposed Signatures:

    • Map(iterator=undefined, comparator="default")
    • Set(iterator=undefined, comparator="default")

The Comparator Selector

  • comparator must be one of the following values
    • "default" // The default comparator is used
    • "==" // == is used
    • "===" // === is used
    • "is" // Object.is is used
  • The default comparator is the same as "Object.is" except that +0/-0 are considered equivalent and all NaN values are equivalent.
  • Other values produce a range error. In the future we might allow a user provided object or function.
  • Note that all the above comparators do object identity comparisons so map/set hash tables would identity based hashing (for objects) and as long as only the built-in map/set/weakmap hash tables are available ther is no need to expose the interlay maintained per object hash value
  • A future user defined comparator could be used for situations where there is a need to do nonidentity based comparison and ES code-level defined hash functions. Typically such comparisons/hasing would be based upon the values of the object properties. Such a comparator would probably have to expose both a comparison method and a hash method.

LH: Require a string value and throw on invalid

MM: happy with this proposal, any dissent?

WH: The comparators must be equivalence relations. Neither == nor === is an equivalence relation, with == breaking particularly badly. It's neither transitive, symmetric, nor reflexive. AWB: You'd simply have unfindable elements. WH: That might work for a multiset but not for something that claims to be a set. You could iterate through the keys and not be able to look up the corresponding elements. If you stick a NaN into such a map, you then couldn't delete it. AWB: Reduce the set of comparators to "is" and "default". WH: Rename "default" to "===" but keep its semantics (NaN's are equal, ±0 are not). AWB, most: Yes. YK: No. Maps should throw on NaN's. WH: Why? Why not throw on undefineds?

Conclusion/Resolution Consensus w/ comparators: "===" (currently default) and "is"

Signatures:

  • Map(iterator=undefined, comparator="===")
  • Set(iterator=undefined, comparator="===")

(Conversation continued, this resolution was discarded)

ARB: if we have a forth form of equality as "default", we should be honest, name it, and make it available separately

YK: Can we use "===" and disallow NaN as a key?

WH: No.

AWB: Why not?

Comparison of the "===" vs Object.is case, w/r to NaN, +0/-0

MM: Move Object.is to Math.is?

WH: No, it accepts non-numbers

WH: The longer we debate this, the more I want to just go with current implementations [that don't have a comparator parameter and always do the "is" semantics].

RW: +1

AWB: We should use this unnamed function as default, "default" is a fine name for it. If there is a demand, we can add it in the future.

EA: We can skip the name...

ARB: You might have circumstances where you do your comparison outside of the map.

MM: General comparator argument, are we happy with this considering a hypothetical future that allows arbitrary equivalence class?

WH: As long as it's an equivalence class, if you allow anything else, you run into trouble.

link Conclusion/Resolution

  • Map( iterator = undefined, comparator = undefined )

  • Set( iterator = undefined, comparator = undefined )

  • If the second argument is "is", use "Object.is"

  • Otherwise, use "==="

1
2
Map.defaultComparator( a, b )
Set.defaultComparator( a, b )

link Comprehensions/Generator Syntax

(Presented by Sam Tobin-Hochstadt)

Dave Herman's proposal: https://gist.github.com/b250d1fad15dbb5f77a5

Existing:

1
let array = [x for x of itr if x > 0];

switch to

1
let array = [for (x of itr) if (x>0) x]

BE: ...Recalling that the draft proposal is right-to-left, this proposal is left-to-right.

...Mixed discussion with reminders of current specification.

LH: Would like to also have a keyword identifier to start the expression, maybe yield

BE: no, that must mean the outer function, not comprehension in it, is a generator, and would yield a directly enclosing function* or throw a SyntaxError otherwise.

BE: also, comprehensions must be lightweight syntactically or there' s no point.

WH: Expresses surprise at existence of parenthesized comprehension syntax: (for (x of itr) if (x>0) x). This one returns an iterator? Somewhat unhappy that the base case doesn't work: [x] returns a one-element array, but (x) returns x, not a one-element iterator.

STH: This is only a syntactic change. We're not altering previously agreed semantics in any way.

link Conclusion/Resolution

All agree on RTL -> LTR change.

[WH: Noted a moment after meeting adjourned that this is not merely a syntactic change. We had let clauses to create intermediate temporaries in the old syntax but not in the new syntax — you can't do [for (x of y) let (z = ...) for (z of q) ...].]

Testing Team Meeting – Jan 31 2013

January 31, 2013

Location: #jquery-meeting on Freenode

Attending: Scott, Richard, Corey, James, Jörn

Time: 11am ET (16:00 UTC)

QUnit

TestSwarm

  • Timo working on projects
    refactoring
  • Puppetized localSettings.json, no
    more edit-on-live server when we need to change our browset sets.

BrowserStack integration

  • Got BrowserStack access to our Splunk
    dashboard. Already helping to fix issues on their end.
  • Now hoping to figure out why we
    loose so many workers.

 

 

Ecma/TC39 Meeting – Jan 30 2013

link January 30 2013 Meeting Notes

John Neumann (JN), Norbert Lindenberg (NL), Allen Wirfs-Brock (AWB), Rick Waldron (RW), Waldemar Horwat (WH), Tim Disney (TD), Eric Ferraiuolo (EF), Sam Tobin-Hochstadt (STH), Erik Arvidsson (EA), Brian Terlson (BT), Luke Hoban (LH), Matt Sweeney (MS), Doug Crockford (DC), Yehuda Katz (YK), Nebojša Ćirić (NC), Brendan Eich (BE), Andreas Rossberg (ARB)

link Function In Block Options

(Presented by Luke Hoban)

Option #1: No let and const in non-strict mode Option #2: Taking the breaking change, w/ evangelism Option #3: Hybrid semantics for function-in-block, that still maintained semantic alignment with let and const Option #4: let/const anywhere in scope changes FIB semantics.

LH: a combination of 1 & 3 might be the best path forward.

Option #3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function foo() {
bar();/// throw, extended TDZ
for (var i = 0; i < 10; i++ ) {
bar(); // throw, TDZ
let x = 10;
// semantics of function in block are as though...
// 1. let bar = function() {} were inserted
// at start of block
// 2. var bar = function() {} were inserted
// at start of function
// (1) accomplishes ES5 let/const semantics,
// (2) accomplishes compat
// These are combined with an extension of the TDZ rules
// to throw on accesses to let bound variables
// whose activation block has not et been created.
function bar() {
console.log(x);
}
bar(); // succeed
}
bar(); // throw, eTDZ
}

WH/ARB: if there is a let or const anywhere in the program, don't do this in sloppy mode?

LH: There is an option, if you have any let or const, then function block is ES6 semantics... But I don't know how we'd define this.

YK: I want to go on record that I don't support this kind of unrelated opt-in.

RW: This is a language level weak inference...

WH: Far less a concern than burning people for the next twenty years.

BE: It's not an opt-in, it's allowing the syntax to speak for itself.

Discussion re: ES6 static semantics to determine runtime semantics.

LH: Option #4 is a possibility

MM: For both strict and non-strict?

LH: Option #4 in sloppy mode and clean up in strict mode. ...Key thing to note: the extended TDZ.

AWB: Is it compatible semantics with whats observed on the web...

Discussion about compatibility of options

STH: Pick one whether it works with what we want to do later

AWB: What are the compatibility requirements?

Discussion re: the sanity of each implementation's semantics.

BE: Not sure any are worth rescuing in sloppy mode. Leaning towards strict mode to align the let, const and fix FIB semantics.

LH: (Presents: http://web.archive.org/web/20120513130620/http://whereswalden.com/2011/01/24/new-es5-strict-mode-requirement-function-statements-not-at-top-level-of-a-program-or-function-are-prohibited/)

Mixed Discussion centered around the intersection of implementation semantics. Need to avoid creating yet a new set of semantics that are outside of the intersection semantics.

Avoid specifying any of this in sloppy mode? BE, MM, ARB, WH agree.

LH: I still think there is something that we can do to make this work.

MM, BE: Avoid two identities for function declarations.

AWB: Reiterates proposal: Don't hoist the initialization of the function, initialize at the point of declaration.

STH: 1) define the semantics of let, const and FIB in sloppy mode and require special casing, 2) don't define let, const and FIB in sloppy mode. Define how the interact that's "mostly compatible with the intersection. Or we prevent them from interacting by ruling out sloppy mode.

BE: ES6 let in sloppy code makes FIB ES6 semantics

Option #2 will be rejected by implementors

Option #1 No let and const in non-strict mode

LH: Addresses compatibility concern, Forks the language.

Paths of teaching JavaScript will hinge on whether you include "use strict".

eg. Can't copy-paste code from blog post into script tag.

MM, WH: Would like a meta tag that makes all scripts and inline JS strict-mode.

LH: Recognizes the ease of copy/paste JavaScript for teaching purposed.

MM: The future will all be "use strict"

RW: In the last two days there has been two different blog posts focused on removing strictness from JavaScript.

YK: Even if you think strict mode is ok now, but still has low uptake. We're making it an obligation for new features which is too large of change.

Mixed discussion about the semantics and restrictions of strict mode.

Further discussion about how simple examples and teaching JS in the future will require "use strict". Recognizing the real consequences of copy/paste restrictions.

LH: Concerned that Option #1 will absorb ALL new things.

Options

Option #0: No new syntax in non-strict mode 0a. Truly no syntax (ARB) Not Alive 0b. Allow module, but nothing else 0c. Allow module and class, but nothing else 0d. Allow everything with a body, but nothing else (the body is implicitly strict) Not Alive

Option #1: No block scoping in non-strict mode No Support 1a. Preserves everything except let, const and FIB

Option #2: Taking the breaking change No Support - (w/ evangelism)

Option #3: Hybrid semantics for function-in-block 3a. In both strict and non-strict No Support 3b. In only non-strict. Strict keeps ES6 block scope functions 3c. Absolute minimum intersection semantics supported in non-strict, else ES6 semantics

Option #4: let/const anywhere in scope changes FIB semantics

Option #5: No block scoping in ES6 Strong Pushback (after discussion)

(Note: "block scoping" means: let, const, class, FIB)

WH: Are the options listed about what we want to spec or what the implementations ought to do (leaving aside the question of whether or how the standard specs it)? LH: Here we're explicitly discussing what implementations should do. [general agreement that this is what we're discussing at this point.]

LH: We cannot do FIB with meaningful semantics in the face of let/const

AWB: If you didn't have FIB, are there still issues?

LH: No. ...To avoid any issues at all, the solution is Option #5.

RW: Does that also include "class"?

STH/LH: Option #3 is the counter point to Option #5.

LH: Option #5 is only legit if Option #3 is rejected.

BE: Option #5 means that class can only appear where functions can appear.

MM: (reiterates belief that one the experiment of extending ES6 features into sloppy mode has failed) ((Note to Rick: We repeatedly clarified that Dave's 1JS is not the extension of ES6 into sloppy mode. It is the earlier realization that we didn't need an additional mode switch, such as an ES6 pragma.))

AWB: Working towards balancing the future... future advantages of block scoping are so large that we should be willing to find a way to make them work.

BE, WH: The future is bigger then the past.

ARB: Wants #0 as cleanest and easiest path forward. (list updated)

BE: Option #0a is dead on arrival. (list updated)

AWB: Does #0d exclude rest and spread, destructuring? (list updated)

BE: Yes, Andreas and others discovered potential issues, probably not worth pushing.

...Yes, going with Option #0, changes the future

STH: One JS is about not having a switch to get new language features, eg. a language version etc.

RW: "use strict" is still a big red switch.

STH: Yes

BE: Committee opinion on #0d? #0d "not alive" (list updated)

Circular discussion about macrocodes caused by Option #1

YK: What about Option #4?

ARB: No.

AWB: Option #4 is an extension of Option #3, because it allows you to safely shift into supporting let and const.

ARB: Strongly dislike because it has a refactoring hazard.

LH: If you're in strict, you already get correct semantics. Option #4 only applies to non-strict mode.

ARB: Want as few component interactions as possible.

WH: This is the closest we can get in the face of web compatibility.

AWB: Proposes Option #3c...? In only the specific cases where a reference does not have a local declaration

WH:

AWB: Willing to throw out function declarations created in eval.

WH: (Whiteboard)

1
2
3
4
5
6
7
8
var f = ...
function a() {
if ( false ) {
function f() {}
}
f();
}

WH: What do we want this to do?

BE: In IE, the inner f hoists. In SpiderMonkey, no hoist. What should we do?

Option #3c: Absolute minimum intersection semantics supported in non-strict, else ES6 semantics.

BE: I think we can do #3c and Allen can make it work, concerned that Waldemar will poke holes and be unhappy.

WH: The above must call the outer f in strict mode. In non-strict mode we shouldn't specify what this does (it becomes a moot point if we continue to outlaw nested functions in non-strict mode). For compatibility we'd want to add an informative note stating that, if the implementation extends non-strict mode with nested functions, the similar program below calls the inner f:

1
2
3
4
5
6
7
8
var f = ...
function a() {
if ( true ) {
function f() {}
}
f();
}

...There is no support for #3a (list updated)

LH: #3b is the bridge between compatibility and progress.

AWB: #3c covers the minimum use cases for compatibility

WH: #3c and 4 are similar

LH: Still supporting #3b

(Break for Lunch)

LH: Summary of current discussion. Why is that people are concerned about any of the #3's?

ARB: A lot of time for the committee to spend on identifying the sloppy mode issues. Why introduce complexity for something "transitional"

LH: So, not really an argument against #3, but for #0

ARB: And not creating a more complicated language

AWB/EA: No.

AWB: [#3] Arguably no more complicated then [#0]

MM: (Uses "duplicate parameters in parameter lists with defaults" as example of adding complexity)

AWB/MM/WH: (Discussion around complexity implications)

AWB: Complexity that occurs in edge cases is not

LH: We can't argue complexity... Let's look at the trade off for long term goals of the language

BE: Can we get rid of Option #1?

Yes. Option #1: no support. (list updated)

LH: For those that support Option #0, If we couldn't get consensus on Option #0, what are the material arguments against Option #3?

BE: (Makes further case for the future friendliness of #0d)

LH: Reiterates the previous question...

BE: Option #3c could work really well

WH: If we go with #3c, there is no spec work, just implementors

AWB: Yes, there is spec work...

Discussion comparing the specifics of #3b & #3c

Support moving to #3c.

AWB: If sloppy mode, here is a compatibility issue.

MM/ARB: (Answering Luke's earlier question) If Option #0 is off the table, then there is no opposition to #3b or #3c.

Consensus

Allen will spec #3c static semantics with informative note for review, tentatively to fallback to #3b

BE: Make an error?

MM: Benefit to future implementors that want to be in conformance by making them errors?

BE: Refutes

MM: Retracts

AWB: Sloppy mode has let, const and class grammatically and semantics

Return to the bigger issue...

Reiterates Kevin Smith's proposal:

  1. No opt-in required for new syntax, except
  2. Except: No breaking changes to sloppy mode
  3. No grammar contortions (e.g. let) to support sloppy mode
  4. All new syntax forms with code bodies are implicit strict

BE: Appears to be stand between #0 and #3

MM: Still opposed to the let issue, by creating a potential hazard.

BE: At last meeting we agreed to break this... (whiteboard)

1
2
var let;
let[x] = y;

AWB: We discussed this last meeting and agreed.

MM: I changed my mind.

WH: This is actually a grammar issue, which means that you must be able to parse it before you know whether or not you're in strict mode.

MM: Reiterates concern about creating potential hazards

LH: If we want to add new syntax, we're going to encounter these issues no matter what "mode" we're in... Hinging new syntax the fact that a small window reserved a few keywords won't scale (let, const, etc).

AWB: There is a certain circularity in arguments that are fine with new features only in strict, but also fine with allowing a single conflicting

MM: Reiterates

WH: So the argument is that we're making "sloppy mode" too attractive?

MM: Yes, avoid linguistic screw-ups.

LH: A lot of us don't view as "screw-ups"

WH: strict mode is just too complicated for user land code with many scripts on one page.

MM: If we're going to continue to support "sloppy mode", we need to make any use of "let" as a variable an error (retro-active reserve?). Cites Safari experiment of "let", Firefox experiments with "let".

LH/BT: Get data on use of "let"

MM: I'm back to where I was previously... I don't care enough to argue anymore.

(Note: Previous discussion can be found here: https://github.com/rwldrn/tc39-notes/blob/master/es6/2012-11/nov-29.md#the-syntax-of-let)

LH: Option #0 is too short sighted and based on "luck"... There won't be another opportunity to retro-reserve words, as there was with Strict Mode

MM: Two scenarios:

  1. A breaking change that leaves the language in a better, more consistent state.
  2. A breaking change that mars the languages and creates something that you constantly need to be aware of...

LH: (anecdotal C# experience)

MM: Counter with sentiments re: language complexity.

AWB/WH: Appear to be converging...

MM: I won't block the let kludge

AWB: But we need to address the larger issue of features in non-strict mode

WH: If there are concrete concerns, I want them on the table, but I don't want to spend more time on abstract arguments.

ARB: Concrete issues have arisen

WH: What are they?

AWB: We expect to have concerns.

ARB: issues with destructuring in sloppy mode

AWB: We have a spec for this.

MM: A spec that special cases for these issues and pays an unnecessary complexity cost.

AWB: Reiterates the concern that user code will not want to "use strict"

EA: I don't want forked languages

ARB/MM: Too many small breaks add up, I want to avoid introducing new breaks.

AWB: Fundamentally two approaches:

  1. A discontinuity, resulting in multiple versions.
  2. A single version, evolves incrementally.

LH: (Insight regarding the effects of "mental forking")

WH/DC: (Discussion about the inline-script problem)

DC: Code has long been moving away from inline code and our goals shouldn't be to preserve that.

LH: But there are still multiple scripts

DC: Strict mode is the path forward, we can maintain ES3 and ES5 "sloppy mode", but ES5 "strict mode" is the way forward.

AWB/YK: Even the term "sloppy mode" is a pejorative.

DC/YK: (Discussion about the current state of strict mode)

WH/YK: We have data that 10% of uses aren't even being used correctly, where "use strict" isn't correctly in the prologue position.

YK: Worried that people will want to use new features, but simply won't understand the requirement "use strict"

DC: This is not hard

...Continued discussion.

LH: ...Interjects to resteer conversation

?: The fundamental disagreement is about whether we want to make a simpler spec for the future by basing new features on strict mode only.

WH: No, that's not the bone of contention. WH would also prefer to have a simpler strict-only spec for new features, but supports 3c/4 from earlier because getting into strict mode is too inconvenient. Today it's too awkward to get into strict mode in practice for web pages, although this may change in the future?. Too many (10%) web pages unknowingly get this wrong by putting a "use strict" somewhere other than the preamble.

MM: What do you see would need to happen to make strict mode convenient enough?

WH: Two requirements:

  1. Need a clear indication that a user's attempt to get into strict mode failed, such as having a use strict directive rather than overloading a string constant. It's obvious from the data that the bug that the strict mode directive doesn't go into strict mode if it's in the wrong place hits too many users.
  2. Need a way to declare that all scripts on a page are strict. That's out of our control, but this is a prerequisite to making strict mode convenient for multi-script pages (and WH is aware of the potential issues of scripts coming from different sources).

YK: Hopefully I've made it clear that the current state of strict mode tooling is at a significant disadvantage.

MM: I understand that we need to work with DOM spec writers to get means of making "global" strict mode a reality.

Revisiting past conversations that led from ES6 being "versioned", to being "strict mode" only, to being "one js".

LH: We did adopt One JS. There have been two concrete issues:

MM: Terminology: "one js"?

LH: As in, new features do not require "use strict" or a "version"... Recommend continuing in the default direction: Continue on the path we're taking.

MM: That is not the meaning of "one js" (Rick: It's really important that we not confuse this issue with 1JS.))

AWB: If we can't agree on a new position.

WH: Wants to hear from others...

RW: (big spiel about strict mode and new features)

EF: Agrees and supports default strict mode in modules. Not enough of a historic sample to say whether what size "switch" and how many "switches" to have will be idea. We only have one real sample so far, ES3 -> ES5. The new ES6 strict mode will only be the second.

RW: Agrees with Eric and supports strict bodies by default.

DC: Including class?

RW: Yes

YK: Not Arrows

MM: Agree, not on that boundary.

LH/MM: Closer to comfort if classes and modules have strict bodies.

MM: Agreed not to hold up consensus

YK/RW: No Arrows

link Conclusion/Resolution

Consensus on... Stay the course on spec development approach Class, Modules implicitly strict. Arrows not strict Sustaining our position on the handling of let ambiguities (Note: this is a local consensus)

MM: Declared as not holding up consensus, though not in agreement. I still think this is a terrible idea, but it looks like the best we can declare consensus on.

BE: (Out of band) I think that's a good consensus, arrows can't have intrinsic names (contrast with NFEs) so arguments.callee may be wanted, so arrows should not be strict-only.

link Static/Class Side Methods

(Presented by Yehuda Katz)

1
2
3
ClassElement:
MethodDefinition
"static" MethodDefinition

Full strawman here: http://wiki.ecmascript.org/doku.php?id=strawman:class_method_syntax

Supported by TypeScript, Continuum, etc.

link Conclusion/Resolution

Consensus in support of this proposal. (File spec update ticket)

link Revising The Array Subclassing "Kind" Issue

(Presented by Allen Wirfs-Brock)

Reiterates the issue at hand, illustrated here:

1
2
3
4
5
6
7
8
9
10
class V extends Array {
constructor(...args) {
super(...args);
}
}
var v, m;
v = new V(1,2,3, );
m = v.map(val => val * 2);
console.log( m instanceof V ); // false :(

If we extend...

Array.from( iterable ) => Array.from( iterable, mapFn )

1
2
3
4
5
6
7
8
// Add a "map" function to the class-side from method:
NodeList.from( nodelist, thing => thing );
// Turn an array into NodeList
NodeList.from( array, thing => thing );
// Turn an array of nodeNames into NodeList of nodes
NodeList.from( ["div"], node => document.createElement(node) );

MM: thisArg?

EF: It's possible to lose the context if you alias the ClassMethod

MM: For consistency purposes, add thisArg

link Conclusion/Resolution

Consensus on this proposal, with the addition of thisArg per Mark's request.

link 4.7 Fail-fast destructuring with ?-syntax for irrefutable opt-in

(Presented by Brendan Eich, Andreas Rossberg)

  1. No ToObject(RHS).
  2. Exception on missing property selected without a ?-suffix.
  3. ?-suffix allowed on any pattern, imputing undefined deeply instead of refuting.
  4. The ? is a separate lexeme from the : in long-hand patterns.

One entry point: https://mail.mozilla.org/pipermail/es-discuss/2013-January/027800.html

Allen argues cogently against (1) but endorses (2-4).

BE: (Whiteboard)

1
var { toLocaleString, split } = "";

The only ones that are affected: string, number, boolean.

ARB: implicit conversion is future-hostile to pattern matching.

STH: (Whiteboard) Example of pattern matching.

switch ("x") { match {}: return 1; match _: return 2; }

You do not want implicit conversions in pattern matching, which would make this take the first branch. Similarly, if we allow matching literal strings.

ARB: For consistency, would imply conversions for other pattern types, too (e.g. literals). No issue technically, but insane from practical perspective

BE: Reiterates... In the case where

There is no history of primitives being used on the RHS, so there is no need to support any kind of implicit ToObject.

"You say po-tah-to and that doesn't change tomato".

...

MM: Question about cover grammar.

AWB: The grammar is spec'ed and in the latest draft.

...

YK: Wants irrefutable destructuring, ie.

1
2
3
4
5
function Foo(options) {
var { foo } = options;
// if foo is not a property of options,
// just give me "foo" that's undefined
}

BE: Use the ?

1
2
3
function Foo(options) {
var { foo }? = options;
}

WH: Is ? deep or shallow? i.e. what should the following do var { p, r }? = q; ? answered:

  • if q is null: p and r are undefined
  • if q is {r: 7}: p is undefined, r is 7. WH: That means that ? is deep.

WH: Given the discussion above [not recorded in these notes?] about doing primitive pattern matching assertions in the future, just curious what the semantics of ? ought to be so that it would interact well with such assertions. Example: What should ? do in these cases? let {p, q}? = {p:17} Here p gets 17 and q gets undefined because ? distributes down. But then what happens when we get value assertions? Without getting into syntax details, assume that x: true is a value assertion that fails unless property x exists and has the value true. let {p: {x: true}}? = null let {p: {x: true}}? = {q: null} let {p: {x: true}}? = {p: null} let {p: {x: true}}? = {p: {}}

Mixed Discussion and debate, re: pattern matching examples.

BE: Return to... Waldemar, are you satisfied with ? for irrefutable destructuring?

WH: The question, is there a purpose of having a shallow "?".

BE: The common case is implied deep "?"

AWB: More comfortable if there was a strawman of what the full language would be like in the future.

BE: Dave has a proposal written, but we need to capture the latest developments.

ARB will work out new pattern matching strawman based on proposed ideas.

BE: (to YK) have we assuaged your concerns about irrefutable destructuring?

YK: yes, as long as "?"

link Conclusion/Resolution

  1. No implicit ToObject(RHS). consensus
  2. Exception on missing property selected without a ?-suffix. consensus
  3. ?-suffix allowed on any pattern, imputing undefined deeply instead of refuting. consensus
  4. The ? is a separate lexeme from the : in long-hand patterns. consensus

"?" in combination with default values, syntax error.

1
{ a? = 42 } // throws.

If you write a "?" on a larger structure, you can have default values anywhere inside.

1
{ a: b = 42 }? = undefined

WH: Where should the ? go syntactically? In particular, should we have {p: q?}, {p:? q}, or {p?: q}

STH:

1
2
3
4
let { p }? = null; // p bound to undefined
let { p? } = null; // throws
let { p: q }? = null; // q bound to undefined
let { p?: q } = null; // throws

WH: This is quite close to conflicting with the ternary operator but can't think of any obvious ambiguities as long as the ? in patterns is always followed by =, }, comma, or :.

Dependent on patterns being fail-fast: ARB: Cute idea: Make undefined into a keyword that is also a pattern that matches only the undefined value. This way existing definitions such as var undefined; and var undefined = ; and (function (undefined){})() will work, but var undefined = 42; will fail.

General Agreement

link 4.11 Name Property of Functions

(Presented by Brendan Eich, with additions by Brandon Benvie) http://wiki.ecmascript.org/doku.php?id=strawman:name_property_of_functions

BE: Early approaches...

1
2
function f() {}
f.name == "f";

BE: (from Brandon Benvie's proposal)

Justification: the usefulness of the name of function is not just for debugging. It is useful in the same ways that property names as strings are such as dispatching by name or assigning by name.

  1. Every function has an own "name" property, and this property is always a string (unless the user specifically decides to violate this norm).
  2. This name property is initialized with the value that makes sense from static semantics.
  3. Allow predefined names to be altered in cases where it makes sense.

Semantics:

The baseline descriptor for every function is the 'name' property defined as { value: "", writable: true, enumerable: false, configurable: false }

For FunctionDeclarations, named FunctionExpressions, MethodDefinitions, or accessor Properties then the function's "name" property is set to the given identifier.

In the case of the constructor method of classes, the class name is used instead.

In the case of accessors, "get" or "set" is included.

The "name" property is set to non-writable.

Function.prototype's name is also non-writable.

Anonymous FunctionExpressions and ArrowFunctionExpressions assigned in a VariableDeclaration or ObjectExpression are given the name of the variable or property they are assigned to and the name remains writable.

Anonymous ClassExpressions follow the same semantics, with the name being used for the constructor method.

Whenever a function's name is defined by a Symbol instead of a regular identifier then the name is the result of ToString(symbol).

The name property should (probably) not have any reflection on the output of Function.prototype.toString.

MM: Having the result of toString be immutable is important, agree with proposal semantics. ...Security leakage from the name property, is the type of information that the toString method leaks. No integrity issue, just a confidentially issue.

BE: We could make Function.prototype.toString be a getter that can be removed.

MM: This is one of the aspects that I gave up attempts to secure, and it's never been an issue.

BE: Make it writable?

WH/MM/AWB/YK: Writable.

WH: There is a slight advantage to making it non-writable. Otherwise when writing it to change the function name, you'd expect it to change the result of "toString".

Discussion re: history of Function.prototype.toString result.

MM: Explain the divergence, toString is a reflection of the source code itself and the name is how you'd like to identify the function within tools.

link Conclusion/Resolution

Consensus on the proposal, with { writable: true }

link 4.12 Typed Arrays Update

(Presented by Allen Wirfs-Brock)

Slides (pdf): http://wiki.ecmascript.org/lib/exe/fetch.php?id=meetings%3Ameeting_jan_29_2013&cache=cache&media=meetings:typedarray_status.pdf

AWB: We're absorbing control of the TypedArray specification, previously authored by Khronos.

W3C has dependencies on the Khronos spec.

This specification will not include any parts of the Khronos spec, but will be compatible.

JN: We need to make sure we're not violating anyone's IPR, Istvan can inquire.

EA: We can have Ken (Kenneth Russell, Google) review the drafts.

LH: Short term, the editors need to understand what's going on and there is no push back. The standards organizations need to know that we're now working on this specification. Agreement

AWB: (Proceeds to technical presentation)

Integrate into ES Spec

  • ES spec conventions and semantics not WebIDL
    • Khronos spec not necessarily tracking WebIDL
    • eg. instanceof
  • Lot's of implementation differences among browsers at MOP level to straighten out
  • TypedArrays are subclassable

LH: TypedArray implementations are incompatible in the same way that all DOM implementations are incompatible, because WebIDL is not implemented compatibly.

Max Length

  • Currently Khronos spec's all lengths as Uint32
  • Not future friendly, especially for byte sussed element arrays
    • eg. a Uint8Array might map to a large real memory-mapped buffer bigger then 4GB.

LH/AWB: Seems that WebIDL is the cause of this constraint.

AWB: I'm going to spec the max length at Int, not Uint32

LH: Should record the deltas

Khronos/W3C TypedArray Objects (Diagram)

AWB: 9 prototype objects, 54 distinct method/get accessor functions per Realm.

MM: How did we get 9?

LH: UintClampedArray, which used to be CanvasPixelArray

Prototype Hierarchy Factoring (Diagram)

AWB: 10 Prototype objects, 6 distinct method/get accessor functions per Realm.

#10, TypedArray.prototype

  • [ BYTES_PER_ELEMENT: int abstract ]
  • set() void
  • subarray() void
  • byteLength() int get
  • byteOffset() int get
  • buffer() Object get
  • length() long get

Int8Array (BYTES_PER_ELEMENT int=1), Int32Array (BYTES_PER_ELEMENT int=4), Uint8Array (BYTES_PER_ELEMENT int=8), Uint32Array (BYTES_PER_ELEMENT int=4), Float32Array (BYTES_PER_ELEMENT int=4), Float64Array (BYTES_PER_ELEMENT int=8), Int16Array (BYTES_PER_ELEMENT int=1), Uint16Array (BYTES_PER_ELEMENT int=1), Uint8ClampedArray

MM: A Uint1Array or BooleanArray, where each element is one bit.

TypedArrays act like fixed length, numeric element JS Arrays

  • So why not even better Array integration?
  • Class methods?
    • TypedArray.of
    • TypedArray.from
  • TypedArrays should be iterables?
    • @@iterator
    • keys
    • values
    • entries

Even Better Array Integration

  • Other Array.prototype methods that will work just fine on TypedArrays
    • toString, toLocaleString, concat, join, reverse, slice, sort, indexOf, lastIndexof, every, some, forEach, map, filter, reduce, reduceRight
  • Only 5 Array.prototype methods won't work with TypedArrays
    • push, pop, shift, unshift, splice

Add Array methods to TypedArray (Diagram)

WH: Are TypedArrays spread by Array.prototype.concat and ...?

LH: TypedArrays are a targeted tool for byte level programming. ...Doesn't think that the generic, higher-order Array APIs should be exposed on TypedArray

WH: [Repeats question]

?: TypedArrays are not exotic arrays so don't get spread by Array.prototype.concat and ... . On the other hand, TypedArray.prototype.concat will spread TypedArrays only.

WH: OK.

[Debate about whether TypedArrays need the suite of Array methods]

YK: Using TypedArrays would be a pain if they didn't already offer these array operations.

WH: It would be too confusing to have gratuitously different APIs for two array-like things in the language.

RW: Agree.

AWB: My understanding was that we were absorbing these in order to provide the capabilities that the language provides

STH/WH/YK/RW/EA: Strong Agreement.

LH: Agree that there are some use-cases for these, but may not be our place to define these methods

YK: (channelling Alex Russell) The reason we're taking this on, is because it's our responsibility to correct "yet another array like thing that isn't an array"

RW: Agrees.

LH: Implementation and performance issue concerns?

WH: This is not a lot of work for implementations, and implementations (as opposed to users) are clearly in the better place to implement these efficiently.

[STH: After the end of the official meeting, there was some discussion as to why Typed Arrays wouldn't just become genuine Arrays. This would mean that they'd have all the Array methods, some of which would throw on use (those that change length). This needs discussion at a future meeting.]

link Conclusion/Resolution

Move forward with the plan presented.