Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for nextJSCtx (0.17 sec)

  1. src/html/template/js_test.go

    		{jsCtxRegexp, "=\u00A0"},
    	}
    
    	for _, test := range tests {
    		if ctx := nextJSCtx([]byte(test.s), jsCtxRegexp); ctx != test.jsCtx {
    			t.Errorf("%q: want %s got %s", test.s, test.jsCtx, ctx)
    		}
    		if ctx := nextJSCtx([]byte(test.s), jsCtxDivOp); ctx != test.jsCtx {
    			t.Errorf("%q: want %s got %s", test.s, test.jsCtx, ctx)
    		}
    	}
    
    	if nextJSCtx([]byte("   "), jsCtxRegexp) != jsCtxRegexp {
    		t.Error("Blank tokens")
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 02:20:11 UTC 2024
    - 12.6K bytes
    - Viewed (0)
  2. src/html/template/js.go

    const jsWhitespace = "\f\n\r\t\v\u0020\u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u2028\u2029\u202f\u205f\u3000\ufeff"
    
    // nextJSCtx returns the context that determines whether a slash after the
    // given run of tokens starts a regular expression instead of a division
    // operator: / or /=.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  3. src/html/template/transition.go

    func tJS(c context, s []byte) (context, int) {
    	i := bytes.IndexAny(s, "\"`'/{}<-#")
    	if i == -1 {
    		// Entire input is non string, comment, regexp tokens.
    		c.jsCtx = nextJSCtx(s, c.jsCtx)
    		return c, len(s)
    	}
    	c.jsCtx = nextJSCtx(s[:i], c.jsCtx)
    	switch s[i] {
    	case '"':
    		c.state, c.jsCtx = stateJSDqStr, jsCtxRegexp
    	case '\'':
    		c.state, c.jsCtx = stateJSSqStr, jsCtxRegexp
    	case '`':
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 11 19:54:31 UTC 2024
    - 18.2K bytes
    - Viewed (0)
Back to top