Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(561)

Issue 4968052: exp/template/html: Implement grammar for JS. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 7 months ago by MikeSamuel
Modified:
12 years, 7 months ago
Reviewers:
CC:
nigeltao, golang-dev
Visibility:
Public.

Description

exp/template/html: Implement grammar for JS. This transitions into a JS state when entering any attribute whose name starts with "on". It does not yet enter a JS on entry into a <script> element as script element handling is introduced in another CL.

Patch Set 1 #

Patch Set 2 : diff -r 4189b98b96cf https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 4189b98b96cf https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 4189b98b96cf https://go.googlecode.com/hg/ #

Total comments: 65

Patch Set 5 : diff -r ad10be38bd25 https://go.googlecode.com/hg/ #

Total comments: 32

Patch Set 6 : diff -r 070b7cc84e48 https://go.googlecode.com/hg/ #

Total comments: 4

Patch Set 7 : diff -r 47d429aad39c https://go.googlecode.com/hg/ #

Total comments: 6

Patch Set 8 : diff -r f845253df880 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1256 lines, -62 lines) Patch
M src/pkg/exp/template/html/Makefile View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/exp/template/html/context.go View 1 2 3 4 5 6 7 3 chunks +46 lines, -6 lines 0 comments Download
M src/pkg/exp/template/html/escape.go View 1 2 3 4 5 6 7 7 chunks +260 lines, -25 lines 0 comments Download
M src/pkg/exp/template/html/escape_test.go View 1 2 3 4 5 6 7 6 chunks +253 lines, -31 lines 0 comments Download
A src/pkg/exp/template/html/js.go View 1 2 3 4 5 6 1 chunk +344 lines, -0 lines 0 comments Download
A src/pkg/exp/template/html/js_test.go View 1 2 3 4 5 6 7 1 chunk +352 lines, -0 lines 0 comments Download

Messages

Total messages: 9
nigeltao
http://codereview.appspot.com/4968052/diff/5001/src/pkg/exp/template/html/context.go File src/pkg/exp/template/html/context.go (right): http://codereview.appspot.com/4968052/diff/5001/src/pkg/exp/template/html/context.go#newcode60 src/pkg/exp/template/html/context.go:60: // stateJSRegex occurs inside a JavaScript regex literal. Go ...
12 years, 7 months ago (2011-08-30 06:37:31 UTC) #1
MikeSamuel
Incremental diffs at http://codereview.appspot.com/4968052/diff2/5001:9001/src/pkg/exp/template/html/context.go http://codereview.appspot.com/4968052/diff/5001/src/pkg/exp/template/html/context.go File src/pkg/exp/template/html/context.go (right): http://codereview.appspot.com/4968052/diff/5001/src/pkg/exp/template/html/context.go#newcode60 src/pkg/exp/template/html/context.go:60: // stateJSRegex occurs inside a ...
12 years, 7 months ago (2011-08-30 20:08:36 UTC) #2
nigeltao
This is getting pretty close... http://codereview.appspot.com/4968052/diff/5001/src/pkg/exp/template/html/escape.go File src/pkg/exp/template/html/escape.go (right): http://codereview.appspot.com/4968052/diff/5001/src/pkg/exp/template/html/escape.go#newcode380 src/pkg/exp/template/html/escape.go:380: quoteAndEsc := "\"\\" On ...
12 years, 7 months ago (2011-08-30 23:45:31 UTC) #3
MikeSamuel
http://codereview.appspot.com/4968052/diff/5001/src/pkg/exp/template/html/escape.go File src/pkg/exp/template/html/escape.go (right): http://codereview.appspot.com/4968052/diff/5001/src/pkg/exp/template/html/escape.go#newcode380 src/pkg/exp/template/html/escape.go:380: quoteAndEsc := "\"\\" On 2011/08/30 23:45:31, nigeltao wrote: > ...
12 years, 7 months ago (2011-08-31 02:03:38 UTC) #4
nigeltao
http://codereview.appspot.com/4968052/diff/9001/src/pkg/exp/template/html/js.go File src/pkg/exp/template/html/js.go (right): http://codereview.appspot.com/4968052/diff/9001/src/pkg/exp/template/html/js.go#newcode17 src/pkg/exp/template/html/js.go:17: // operator : (/ or /=). On 2011/08/30 23:45:32, ...
12 years, 7 months ago (2011-08-31 08:51:02 UTC) #5
MikeSamuel
I don't know how I missed those comments before. Incremental diffs at http://codereview.appspot.com/4968052/diff2/11002:13007/src/pkg/exp/template/html/escape.go http://codereview.appspot.com/4968052/diff/9001/src/pkg/exp/template/html/js.go File ...
12 years, 7 months ago (2011-08-31 17:32:38 UTC) #6
nigeltao
LGTM. Just a few nits (yes, I'm retentive) that I'll fix when I submit. http://codereview.appspot.com/4968052/diff/13007/src/pkg/exp/template/html/context.go ...
12 years, 7 months ago (2011-09-01 01:59:32 UTC) #7
MikeSamuel
Incremental diffs at http://codereview.appspot.com/4968052/diff2/13007:19001/src/pkg/exp/template/html/context.go http://codereview.appspot.com/4968052/diff/13007/src/pkg/exp/template/html/context.go File src/pkg/exp/template/html/context.go (right): http://codereview.appspot.com/4968052/diff/13007/src/pkg/exp/template/html/context.go#newcode159 src/pkg/exp/template/html/context.go:159: // jsCtxRegexp occurs where a ...
12 years, 7 months ago (2011-09-01 02:04:38 UTC) #8
nigeltao
12 years, 7 months ago (2011-09-01 02:07:53 UTC) #9
*** Submitted as http://code.google.com/p/go/source/detail?r=68c83c6fed16 ***

exp/template/html: Implement grammar for JS.

This transitions into a JS state when entering any attribute whose
name starts with "on".

It does not yet enter a JS on entry into a <script> element as script
element handling is introduced in another CL.

R=nigeltao
CC=golang-dev
http://codereview.appspot.com/4968052

Committer: Nigel Tao <nigeltao@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b