20.06.15

New changes to make SpiderMonkey’s (and Firefox’s) parsing of destructuring patterns more spec-compliant

Destructuring in JavaScript

One new feature in JavaScript, introduced in ECMAScript 6 (formally ECMAScript 2015, but it’ll always be ES6 in our hearts), is destructuring. Destructuring is syntactic sugar for assigning sub-values within a single value — nested properties, iteration results, &c., to arbitrary depths — to a set of locations (names, properties, &c.).

// Declarations
var [a, b] = [1, 2]; // a = 1, b = 2
var { x: c, y: d } = { x: 42, y: 17 }; // c = 42, d = 17

function f([z]) { return z; }
print(f([8675309])); // 8675309


// Assignments
[b, f.prop] = [3, 15]; // b = 3, f.prop = 15
({ p: d } = { p: 33 }); // d = 33

function Point(x, y) { this.x = x; this.y = y; }

// Nesting's copacetic, too.
// a = 2, b = 4, c = 8, d = 16
[{ x: a, y: b }, [c, d]] = [new Point(2, 4), [8, 16]];

Ambiguities in the parsing of destructuring

One wrinkle to destructuring is its ambiguity: reading start to finish, is a “destructuring pattern” instead a literal? Until any succeeding = is observed, it’s impossible to know. And for object destructuring patterns, could the “pattern” just be a block statement? (A block statement is a list of statements inside {}, e.g. many loop bodies.)

How ES6 handles the potential parser ambiguities in destructuring

ES6 says an apparent “pattern” could be any of these possibilities: the only way to know is to completely parse the expression/statement. There are more elegant and less elegant ways to do this, although in the end they amount to the same thing.

Object destructuring patterns present somewhat less ambiguity than array patterns. In expression context, { may begin an object literal or an object destructuring pattern (just as [ does for arrays, mutatis mutandis). But in statement context, { since the dawn of JavaScript only begins a block statement, never an object literal — and now, never an object destructuring pattern.

How then to write object destructuring pattern assignments not in expression context? For some time SpiderMonkey has allowed destructuring patterns to be parenthesized, incidentally eliminating this ambiguity. But ES6 chose another path. In ES6 destructuring patterns must not be parenthesized, at any level of nesting within the pattern. And in declarative destructuring patterns (but not in destructuring assignments), declaration names also must not be parenthesized.

SpiderMonkey now adheres to ES6 in requiring no parentheses around destructuring patterns

As of several hours ago on mozilla-inbound, SpiderMonkey conforms to ES6’s parsing requirements for destructuring, with respect to parenthesization. These examples are all now syntax errors:

// Declarations
var [(a)] = [1]; // BAD, a parenthesized
var { x: (c) } = {}; // BAD, c parenthesized
var { o: ({ p: p }) } = { o: { p: 2 } }; // BAD, nested pattern parenthesized

function f([(z)]) { return z; } // BAD, z parenthesized

// Top level
({ p: a }) = { p: 42 }; // BAD, pattern parenthesized
([a]) = [5]; // BAD, pattern parenthesized

// Nested
[({ p: a }), { x: c }] = [{}, {}]; // BAD, nested pattern parenthesized

Non-array/object patterns in destructuring assignments, outside of declarations, can still be parenthesized:

// Assignments
[(b)] = [3]; // OK: parentheses allowed around non-pattern in a non-declaration assignment
({ p: (d) } = {}); // OK: ditto
[(parseInt.prop)] = [3]; // OK: parseInt.prop not a pattern, assigns parseInt.prop = 3

Conclusion

These changes shouldn’t much disrupt anyone writing JS. Parentheses around array patterns are unnecessary and are easily removed. For object patterns, instead of parenthesizing the object pattern, parenthesize the whole assignment. No big deal!

// Assignments
([b]) = [3]; // BAD: parentheses around array pattern
[b] = [3]; // GOOD

({ p: d }) = { p: 2 }; // BAD: parentheses around object pattern
({ p: d } = { p: 2 }); // GOOD

One step forward for SpiderMonkey standards compliance!

16.06.15

San Francisco v. Sheehan: opinion and analysis

Last time I gave my last pre-opinion thoughts on the Texas specialty license plate case, Walker v. Texas Division, Sons of Confederate Veterans, whose oral argument I attended in March. The other case I saw that day, San Francisco v. Sheehan, was recently decided. Today I discuss the opinions in that case.

Ninth Circuit overturned, film at 11

My dismissive suggestion that San Francisco would win because Ninth Circuit and qualified immunity was on target. The Court ruled, 6-2, that the officers should receive qualified immunity — giving the win to San Francisco.

The Americans with Disabilities Act and accommodating the disabled

Recall that Justice Scalia and others alleged that San Francisco had improperly changed its argument from the time it got the Supreme Court to hear the case, to when it presented its formal argument. San Francisco initially argued that the Americans with Disabilities Act categorically didn’t require officers to accommodate armed and violent suspects who are disabled. But then later it argued that the ADA didn’t apply specifically to Sheehan, because she had posed a “direct threat”.

Every justice agreed that San Francisco’s tactics precluded the Court from deciding whether the ADA applied to armed and violent disabled suspects. So that’s still an open question awaiting a case properly presenting it.

Disposing of the rest of the case

But then what happens to the case and its remaining questions, if the ADA question is dismissed? The six-justice majority decided that the officers deserved qualified immunity. Justice Scalia, joined by Justice Kagan, argued that San Francisco shouldn’t be given a win for “snookering” the Court, when the Court wouldn’t have answered the qualified immunity question if presented alone. Instead the Court should have dismissed the entire case, leaving San Francisco to its loss in the Ninth Circuit.

Thoughts

I previously wasn’t entirely certain that San Francisco had changed its argument. But in light of the Court’s unanimous agreement on the matter, and in light of other commentary, it seems clear that it did.

I wasn’t aware the Court could dismiss “half” a case; that seems reasonable for the ADA question. For the remainder of the case, I think I lean toward Scalia’s and Kagan’s view. It’s unfair to parties in cases to allow one side to make an argument, then not be held to that argument come decision time. But I didn’t trace the majority’s cites far enough to conclude that its position was definitely wrong, so count my agreement with Scalia and Kagan as only tentative.

Next time, discussion of the ultimate opinion in Walker v. Texas Division, Sons of Confederate Veterans. The case is still pending, so I can’t yet say when that post might be ready.

15.06.15

Final thoughts on Walker v. Texas Division, Sons of Confederate Veterans

Two months ago I began a blog post series about my recent visit to the Supreme Court for oral arguments in two cases. San Francisco v. Sheehan concerned police use of force in San Francisco; Walker v. Texas Division, Sons of Confederate Veterans concerned Texas’s specialty license plate program and its restrictions on permissible designs. Seven weeks ago I discussed oral argument in the Texas license plate case. Today I return for final thoughts on the Texas license plate case, in which a decision is expected any day now — perhaps even in an hour today.

(Why the seven-week delay when I’d promised merely “a day or two”? The day of the last post, I underwent [relatively] minor surgery for pain from a high ankle sprain, that hadn’t fully responded to approaches short of arthroscopic ankle surgery. [The surgery seems to have been successful, but I probably can’t be sure til I regain full ankle flexibility/strength. I can walk almost entirely normally now, but strength and flexibility are still noticeably diminished, albeit improving daily.] Although I had spare time immediately afterward, I wasn’t particularly inclined to post-writing, and as time passed I never got back in the groove. Time winding down before the ultimate opinion has put me back on track. :-) )

Back to forum analysis

Before I tackled oral argument, my previous posts discussed offensive speech. I left one question hanging: what sort of forum is Texas’s specialty license plate program? Is it a designated public forum or a limited public forum?

This turns out not to matter. To judge offensiveness requires adopting a particular viewpoint, but regardless which sort of forum Texas specialty plates are, restrictions must be viewpoint-neutral. As for Texas’s argument that judging offensiveness is “objective” and viewpoint-neutral, this plainly must fall in light of the Court’s repeated insistence that “the government may not prohibit the expression of an idea simply because society finds the idea itself offensive”.

Censoring based on offensiveness is not viewpoint-neutral. But in either a designated public forum or a limited public forum, restrictions must be viewpoint-neutral. So it doesn’t matter which Texas’s program is: prohibitions based on offensiveness must fall.

My opinion

On Texas

If you’ve paid any attention to this series, it should be obvious that I think Texas must lose. When Texas opened up a forum for speech on plates and invited essentially everyone onto them, they lost control over what can be said there. An amicus brief from the Rutherford Institute best captures my thoughts on this case. (Which isn’t to say I disagree with other briefs supporting Texas SCV, simply that the approach here best matches my reasoning.)

Other specialty plate programs

So much for Texas’s program. What about programs in other states? Such disputes previously have centered on Confederate flags (by other SCV divisions), but perhaps the most prominent topic of controversy has been adoption/abortion/pro-life/pro-choice advocacy. Some states have explicitly ordered designs taking sides in that controversy, or have approved such designs submitted by private parties. Inevitably the other side files suit for a chance to say its piece. What should happen? I think it depends on the contours of the program.

If a state legislature passes a law ordering a design be produced, or delegating that to the state DMV, that legitimately does seem to me to be government speech. Private parties have no right to butt in to demand alternative designs. The place to challenge such programs is in the voting booth, not the courthouse. The same is true if privately-submitted designs receive legislative approval in a pick-and-choose process: the available designs are government speech (although the designs themselves may be hybrid speech).

On the other hand, if a state provides a specialty plate program in which private parties may request designs, and those designs aren’t explicitly limited to particular topics, the specialty plate program is a designated public forum in which permitted private parties can say whatever they want. (Subject to the usual traditional public forum restrictions.) (This is Texas’s program.)

If the state provides an open program with restrictions, then we have a limited public forum. A specialty plate program along these lines might or might not be able to exclude speakers. For example, many Texas designs recognize particular colleges. A state program allowing only colleges to submit designs, consisting of a color scheme and a logo, wouldn’t be required to accept a specialty plate on some other topic, or from a non-college. A specialty plate program that allowed, say, “non-political” designs only would be a much closer question that would probably swing the other way. (Who’s to say what’s political and what isn’t, “viewpoint-neutrally”?) But if criteria were objective and viewpoint-neutral, restrictions might be permissible.

Justice Kennedy’s concern that striking Texas’s program “curtails” speech

One slightly disconcerting moment at oral argument came after Texas SCV argued that Texas pretty much couldn’t prohibit anything on specialty plates. With minor adjustments for readability:

Justice Scalia
So you’re — you’re really arguing for the abolition of Texas specialty plates, aren’t you? I couldn’t make a better argument for — in that direction than — than what you’ve been doing.
Mr. George
Well, we had got along without it a long time before we got it, and we can get along without it again.
Justice Kennedy
So in a way, your argument curtails speech?

I’m not sure whether this ever received an answer. But the answer I’d have given is simple: “We call Texas’s bluff.” As I’ve noted, other states have had to respond to court cases in favor of unliked speakers: on license plates, in Adopt-A-Highway programs, in municipal transit ad programs, and so on. The states and cities operating these programs generally haven’t shut down the programs to prevent undesirable speakers from speaking, and many don’t even adjust program parameters to work around court decisions. No matter what it might bluster, Texas won’t shut down its program if it loses. Only very few ill-mannered states are likely to pick up their toys and leave, rather than share them with speakers they don’t like.

Predictions

My prediction is that Texas will lose unanimously. The justices generally were somewhat taken aback by the sprawling assertions made by Texas SCV, but that seems only natural when good people contemplate potentially allowing vile, racist speech. The justices, as judges, ultimately must be, and are, less susceptible to these emotional tuggings than it might seem in the moment of argument. This is a very pro-speech Court; I think they’ll have very little trouble getting over their prejudices against speech they might not like.

Only Justice Scalia seemed to have particular sympathy for Texas, and for Texas being permitted to run its program however it wants. I think he viewed specialty plates and programs as mostly one giant exercise in frivolity: “Why aren’t bumper stickers good enough?”, “Why does anyone care what’s on their license plate?”, to put words in his mouth. There’s something to that: if we returned to a world where license plates were solid-color letters on a solid-color background, it’s hard to say anyone would really be much worse off. But just because a particular means of speech seems unbelievably stupid doesn’t justify shutting it down. I don’t think Justice Scalia would hang up on that in an opinion.

Ultimately I think the open nature of Texas’s invitation, combined with the standardless system by which Texas can reject designs, will sway him against Texas, even if he thinks the entire controversy is a waste of time. Justice Scalia was one of the votes striking down statutes criminalizing flag-burning on the basis of its offensiveness. I don’t see how he would abrogate that position on offensive speech just because Texas nominally exercises “effective[] control” over the specialty license plate program but doesn’t specifically cabin designs to limited topics.

Next time I return to San Francisco v. Sheehan to discuss the opinion in that case. And unlike last time, I’ll guarantee this discussion will issue tomorrow. (Barring Dreamhost downtime, server issues, Judgment Day, &c.) :-)

27.04.15

Texas license plate oral argument

Yesterday I discussed offensive speech, especially relevant to the Texas license plate situation because the design’s being seen as “offensive” was Texas’s justification for denying Texas SCV‘s request. Today I talk a bit about oral argument.

Government speech

Texas hammered on its government-speech argument, but it generally didn’t get a very receptive audience. As Lyle Denniston observed, most of the justices’ questions and comments implicitly assumed there was a free speech issue to determine — which wouldn’t be the case if Texas SCV’s design were government speech. I doubt there’s more than a vote or two for these plates being government speech, if that.

One particularly gratifying discussion of government speech occurred when Texas’s advocate attempted to assert the specialty license plates were government speech because of the level of control, and Justice Kennedy noted the circularity of the argument. It was good to see practically the first problem I noticed in Texas’s argument, was also noticed on the bench. Chief Justice Roberts’s expression of skepticism about the program having no clear, identifiable policy being articulated, instead stating Texas was doing it for money (later joined by Justice Alito on the latter point), was also welcome.

A fair bit of time was spent discussing hypothetical “Vote Republican” and “Vote Democrat” license plates, and whether a state might approve one and deny the other. It’s not clear to me (nor was it clear to the justices) that “government speech” would directly prohibit this, but various “independent rules” were observed that would prevent such (just as such electioneering would be prohibited, somehow, in official ballots).

Forums

As I suggested earlier, Texas’s specialty plates program seems to be either a designated public forum or a limited public forum. Justice Kennedy picked up on this, asking if this was a case where Texas had opened “a new public forum in a new era”. Justice Alito posed multiple hypothetical questions involving government-established places where speech might occur, and the implication I drew from his comments suggested that he also viewed such cases as public forums. Each justice also presented hypothetical cases where the government set up a place for speech to happen (a billboard with a state message on it, with a small space for private speech to take place; officially-designated soapboxes in parks), then questioned whether it could be government speech or instead a public forum.

Justice Alito also probed the nature of the license plate forum if the state accepted only colleges, then colleges plus scenic places, and so on, gradually expanding into everyone. The point being: at what dividing line is a scheme no longer government speech? Texas SCV’s answer was that every state-designed plate would be government speech — but plates designed by private entities would be those entities’ speech.

“Offensive” speech

Various justices expressed concern that approving Texas’s denial might lead to regulation of offensiveness in other forums. Justice Ginsburg characterized the “might be offensive” standard as “nebulous” and granting too much discretion. Justice Kagan worried about approval of regulation of offense spreading into more and more forums, producing more and more regulation of speech.

The true fireworks for offensiveness, of course, arose when Texas SCV’s free-speech nut lawyer rose to defend their position. In essence he argued that once Texas extended an open invitation to anybody, they no longer could control what was said. Then, in response to successive questions, he argued Texas couldn’t prohibit license plates with swastikas, “jihad” (which he initially misheard as “vegan”, to laughter), “Make pot legal”, “BONG HiTS 4 JESUS” (more laughter, and a high point of the argument), and ultimately “the most offensive racial epithet that you can imagine”. Truly it was a glorious display of zeal for freedom of speech.

A banner reading "BONG HiTS 4 JESUS", displayed by Joseph Frederick and ultimately leading to the school speech case of Morse v. Frederick
A banner “reasonably viewed as promoting illegal drug use”, or “dumb advocacy”? But maybe protected speech, on a specialty license plate (picture by Mlschafer, public domain)

Selectivity

Various justices also made comments as to Texas’s non-selectivity in approving plates. Texas approved over 400 plates and rejected only around a dozen. Clearly several justices thought that near-blanket approval weakened any argument Texas might have for the state carefully exercising discretion in every instance, and strengthened the argument that they’d opened up a public forum for speech.

Those are some of the high points of argument. If you’re interested in more detail, see the transcript.

Next time, it’s probably on to a series wrapup. But no promises yet, as I haven’t written up enough thoughts to be certain. And again, as I noted yesterday, this might end up delayed a day or two. Til next time!

26.04.15

Offensive speech

Yesterday I discussed First Amendment forum doctrine as it related to Texas’s specialty plate program. Today I discuss the subject where everyone learns to stop worrying and love censorship: “offensive” speech.

Trollface
If you reach the end of this post without having been offended at least once, I apologize for the error. (But I am serious about all the arguments made here, trolling for offense notwithstanding.)

“Offensive” speech

Texas denied Texas SCV‘s design because “the design might be offensive to any member of the public” (emphases added). A mere possibility of offense, to a single person, allows Texas (if it wants, as a matter of even-handed objectivity and fairness) to tell the plate requester to pound sand.

What does the First Amendment say about “offensive” speech? Offensive speech particularly is strongly protected. The First Amendment lets you victim-blame soldiers at their own funerals. It lets you burn the American flag, notwithstanding that this “seriously offended” several witnesses. It lets you satirically attribute false quotations to someone implying that his first sexual experience occurred in an outhouse with his own mother…after kicking out the goat. It protects the right to wear an undoubtedly-offensive jacket bearing the words “Fuck the Draft”. It protects a student newspaper cover depicting police officers raping the Statue of Liberty. It lets you falsely claim to have received the highest and most respected of military awards, in some sense diminishing that award’s value. The list goes on and on.

An American flag held, burning, touching the ground
Freedom of speech (picture apparently by noplur, CC-BY-SA-2.0)

The First Amendment was designed to protect offensive and unpopular speech, full stop. “If there is a bedrock principle underlying the First Amendment, it is that the government may not prohibit the expression of an idea simply because society finds the idea itself offensive or disagreeable.” “The fact that protected speech may be offensive to some does not justify its suppression.” As the Court stated regarding a more restrictive forum than the public sphere where license plates reside, “The mere dissemination of ideas — no matter how offensive to good taste — may not be shut off in the name alone of ‘conventions of decency.'”

In short, Texas is horribly wrong to think it has authority to censor offensive specialty plate designs based on “levels of offensiveness” (which, we must remember, was Texas’s post hoc rationale, not anything in the law).

Could the Confederate flag be “fighting words”?

Is some offensive speech nonetheless unprotected? Yes, but it must be fighting words that “by their very utterance, inflict injury or tend to incite an immediate breach of the peace.” No one here argues Texas law is really trying to criminalize fighting words, because doing so would run into (at least) two major problems.

First, Texas concedes that Texas SCV could display a bumper sticker with identical design on vehicles. But it’s irrational to think moving a hypothetically-inciting message a few inches would change that aspect of its nature. If a plate design met that standard, then so would a bumper sticker, and both could be forbidden.

Second, Texas’s “might be offensive to any member of the public” rule goes far beyond fighting words. “Choose Life” or “Respect Choice” specialty plates (or even “All Lives Matter”, which is clearly offensive and you should check your privilege, you racist member of the patriarchy) would offend some people. But it’s inconceivable (not meant that way) these could ever be considered fighting words, rather than protected political statements.

If Texas were to argue its “offensiveness” standard addressed fighting words (and it doesn’t), the statute would be substantially overbroad in criminalizing too much speech and accordingly vulnerable to challenge. Even Texas isn’t stupid enough to try to argue this.

What about “hate speech”?

The First Amendment protects hate speech. You can burn a cross on your own property without intent to intimidate, and it’s protected speech. You can hold a Nazi parade on public streets, even if Holocaust survivors say that “seeing the swastika was like being physically attacked.” You can make various forms of pornography that “subordinat[e] women” in a variety of reprehensible ways, and laws against such will be struck down.

A Neo-Nazi rally on the US Capitol grounds
I hate Illinois Nazis. But this is, rightly, protected speech. (original by David, CC-BY-2.0)

And the recent American kerfuffles over various fraternities’ obnoxious racist speech pretty much all constitute protected speech, for which the perpetrators have been widely judged protected from punishment by public universities. (The universities can get away with whatever punishment they want if the perpetrators won’t stand up for themselves in court. [An action which doesn’t prevent a sincere apology and work toward rehabilitation.] Fortunately, not all universities [#notalluniversities] [#butmost] have forgotten their duties under the First Amendment and their obligations to protect academic freedom even when it hurts.)

The imagined “hate speech” exception to the First Amendment, and to freedom of speech more generally, doesn’t exist.

I see. So you’re a racist bigot standing in the way of progress and social justice?

No. There are plenty of horrible forms of expression that nonetheless are protected by the First Amendment, and should be protected. I don’t need to agree with anything anyone says in order to defend their right to say it. (But by all means continue with the insults! I appreciate the encouragement.)

But consider the alternative to allowing all this speech. Suppose we really did think it was okay to punish some of this speech. What neutral arbitrator is going to decide which categories of speech are okay and which are not okay? Who’s going to neutrally enforce such laws in a non-discriminatory manner? There is no neutral arbitrator: rather, the majority will. And history shows that when a majority has the power to censor, it’ll censor things according to its own interests, not according to some “neutral” perspective able to judge what speech is and isn’t permissible.

Indeed, when the standard is that “offensive” speech is prohibited, aren’t minority views precisely those most likely to be deemed offensive? Inoffensive views aren’t the ones that need protection. Rather, it’s the offensive views that need protection, because majorities often aren’t inclined to protect offensive views. Nobody’s going to complain when someone says “Stop Child Abuse”, but they might about a discussion of then-offensive homosexual marriage.

Offensiveness and correctness aren’t always in agreement

Protecting offensive speech is particularly important because because offensive views may also be right. Martin Luther opening a scholarly debate among theologians about corrupt Church practices in the Ninety-Five Theses offended Johann Tetzel and the Church. (Whether or not Luther or the Church was right, I think we can generally agree the world is a better place for that debate having taken place.) Galileo’s astronomical hypotheses offended many astronomers of the day, and notoriously the Church. John Quincy Adams’s speech in bringing petitions “about” slavery before Congress, where Southern congressmen, fearful of what petitions on the topic of slavery might say, had previously voted in a rule to immediately table any petition on the subject, offended those congressmen. Paul Robert Cohen offended many people in protesting a draft later ended, attributable to some small degree to his speech about it. Archie Bunker epitomized bigotry, yet without it All in the Family couldn’t have made the points it made. (Query whether they could make that series today without being shouted down by the congenitally-stupid.)

It’s easier to judge people who say offensive things

Additionally, offensive speech permits the observer to judge people for what they’ve said. Censorship that prohibits expression of particular views also makes it harder to determine whether a person nonetheless holds them.

(It’s not a First Amendment question, but as a matter of the broader concept of freedom of speech, and the expression and discussion of ideas, I wonder if sometimes we take stigmatization too far. That is, we take it to the point where most adherents to an odious idea adhere in silence, with no way to recognize such people when it’s most important to be able to do so — for personal physical safety, for example. The apparent absence of bigots, when everyone agrees they still exist at least sometimes, can all too easily trigger paranoia. The consequent imputation of widespread bigotry without actual proof, in an overly-broad manner, serves no useful purpose.)

Moving on…

I could write more about this, but I’m well past the length of any prior post and running out of time to write more. I leave readers with a recommendation for further reading: the brief of the Cato Institute and others (most notably including the humorist P. J. O’Rourke and former ACLU president Nadine Strossen) in this case. Its discussion and examples are truly disgusting, an awful piece of work. And this is precisely what makes it so great.

Next time, various observations on oral argument. I still have writing to do here, so this might slip a day or two. Not clear. But right now I’m still aiming for it to go live tomorrow.

Older »