Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: src/harmony-templates.js

Issue 663683006: Implement ES6 Template Literals (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove TemplateLiteral AST node, do it all in parsing Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 'use strict';
6
7 function GetTemplateCallSite(cookedStrings, rawStrings) {
arv (Not doing code reviews) 2014/11/07 16:55:50 Eventually I think we need to pass in some kind of
8 // TODO(caitp): ensure same template callsite is used for subsequent tag calls
9 var count = cookedStrings.length;
10 var siteObj = new $Array(count);
11 var rawObj = new $Array(count);
12
13 var index = 0;
14 for (; index < count; ++index) {
15 var cookedValue = cookedStrings[index];
16 DefineArrayProperty(siteObj, ToString(index), ToPropertyDescriptor({
17 value: cookedValue,
18 configurable: false,
19 writable: false,
20 enumerable: true
21 }), false);
22 var rawValue = rawStrings[index];
23 DefineArrayProperty(rawObj, ToString(index), ToPropertyDescriptor({
24 value: rawValue,
25 configurable: false,
26 writable: false,
27 enumerable: true
28 }), false);
29 }
30
31 DefineObjectProperty(siteObj, "raw", ToPropertyDescriptor({
32 value: %ObjectFreeze(rawObj),
33 configurable: false,
34 writable: false,
35 enumerable: false
36 }), false);
37
38 return %ObjectFreeze(siteObj);
39 }
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/messages.js » ('j') | test/cctest/test-parsing.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698