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

Side by Side Diff: src/js/v8natives.js

Issue 1423663006: [es7] Implement async functions parsing Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/globals.h ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils) { 5 (function(global, utils) {
6 6
7 %CheckIsBootstrapping(); 7 %CheckIsBootstrapping();
8 8
9 // ---------------------------------------------------------------------------- 9 // ----------------------------------------------------------------------------
10 // Imports 10 // Imports
(...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after
1676 1676
1677 if (%FunctionIsArrow(func)) { 1677 if (%FunctionIsArrow(func)) {
1678 return source; 1678 return source;
1679 } 1679 }
1680 1680
1681 var name = %FunctionNameShouldPrintAsAnonymous(func) 1681 var name = %FunctionNameShouldPrintAsAnonymous(func)
1682 ? 'anonymous' 1682 ? 'anonymous'
1683 : %FunctionGetName(func); 1683 : %FunctionGetName(func);
1684 1684
1685 var isGenerator = %FunctionIsGenerator(func); 1685 var isGenerator = %FunctionIsGenerator(func);
1686 var isAsync = %FunctionIsAsync(func);
1686 var head = %FunctionIsConciseMethod(func) 1687 var head = %FunctionIsConciseMethod(func)
1687 ? (isGenerator ? '*' : '') 1688 ? (isGenerator ? '*' : '')
1688 : (isGenerator ? 'function* ' : 'function '); 1689 : (isGenerator ? 'function* ' : 'function ');
1689 return head + name + source; 1690 return (isAsync ? 'async ' : '') + head + name + source;
1690 } 1691 }
1691 1692
1692 1693
1693 function FunctionToString() { 1694 function FunctionToString() {
1694 return FunctionSourceString(this); 1695 return FunctionSourceString(this);
1695 } 1696 }
1696 1697
1697 1698
1698 // ES5 15.3.4.5 1699 // ES5 15.3.4.5
1699 function FunctionBind(this_arg) { // Length is 1. 1700 function FunctionBind(this_arg) { // Length is 1.
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1849 %InstallToContext([ 1850 %InstallToContext([
1850 "global_eval_fun", GlobalEval, 1851 "global_eval_fun", GlobalEval,
1851 "object_value_of", ObjectValueOf, 1852 "object_value_of", ObjectValueOf,
1852 "object_to_string", ObjectToString, 1853 "object_to_string", ObjectToString,
1853 "object_define_own_property", DefineOwnPropertyFromAPI, 1854 "object_define_own_property", DefineOwnPropertyFromAPI,
1854 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor, 1855 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor,
1855 "to_complete_property_descriptor", ToCompletePropertyDescriptor, 1856 "to_complete_property_descriptor", ToCompletePropertyDescriptor,
1856 ]); 1857 ]);
1857 1858
1858 }) 1859 })
OLDNEW
« no previous file with comments | « src/globals.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698