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

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: ensure scanner flag is initialized to false 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
« no previous file with comments | « src/flag-definitions.h ('k') | src/messages.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
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 for (var index = 0; index < count; ++index) {
14 var prop = ToString(index);
15 var cookedValue = cookedStrings[index];
16 DefineArrayProperty(siteObj, prop, ToPropertyDescriptor({
arv (Not doing code reviews) 2014/11/12 15:06:05 I feel like this is doing too much work. Nothing
caitp (gmail) 2014/11/12 15:12:32 Done. It's a lot tinier that way.
17 value: cookedValue,
18 configurable: false,
19 writable: false,
20 enumerable: true
21 }), false);
22 var rawValue = rawStrings[index];
23 DefineArrayProperty(rawObj, prop, 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698