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

Side by Side Diff: src/v8natives.js

Issue 477263002: ES6: Add support for method shorthand in object literals (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: merge Created 6 years, 3 months 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/runtime.cc ('k') | src/x64/full-codegen-x64.cc » ('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 // This file relies on the fact that the following declarations have been made 5 // This file relies on the fact that the following declarations have been made
6 // in runtime.js: 6 // in runtime.js:
7 // var $Object = global.Object; 7 // var $Object = global.Object;
8 // var $Boolean = global.Boolean; 8 // var $Boolean = global.Boolean;
9 // var $Number = global.Number; 9 // var $Number = global.Number;
10 // var $Function = global.Function; 10 // var $Function = global.Function;
(...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after
1750 } 1750 }
1751 } 1751 }
1752 1752
1753 if (%FunctionIsArrow(func)) { 1753 if (%FunctionIsArrow(func)) {
1754 return source; 1754 return source;
1755 } 1755 }
1756 1756
1757 var name = %FunctionNameShouldPrintAsAnonymous(func) 1757 var name = %FunctionNameShouldPrintAsAnonymous(func)
1758 ? 'anonymous' 1758 ? 'anonymous'
1759 : %FunctionGetName(func); 1759 : %FunctionGetName(func);
1760 var head = %FunctionIsGenerator(func) ? 'function* ' : 'function '; 1760
1761 // TODO(arv): Handle concise generator methods.
1762
1763 var head = %FunctionIsConciseMethod(func)
1764 ? ''
1765 : %FunctionIsGenerator(func) ? 'function* ' : 'function ';
1761 return head + name + source; 1766 return head + name + source;
1762 } 1767 }
1763 1768
1764 1769
1765 function FunctionToString() { 1770 function FunctionToString() {
1766 return FunctionSourceString(this); 1771 return FunctionSourceString(this);
1767 } 1772 }
1768 1773
1769 1774
1770 // ES5 15.3.4.5 1775 // ES5 15.3.4.5
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1901 } 1906 }
1902 if (!IS_SPEC_FUNCTION(method)) { 1907 if (!IS_SPEC_FUNCTION(method)) {
1903 throw MakeTypeError('not_iterable', [obj]); 1908 throw MakeTypeError('not_iterable', [obj]);
1904 } 1909 }
1905 var iterator = %_CallFunction(obj, method); 1910 var iterator = %_CallFunction(obj, method);
1906 if (!IS_SPEC_OBJECT(iterator)) { 1911 if (!IS_SPEC_OBJECT(iterator)) {
1907 throw MakeTypeError('not_an_iterator', [iterator]); 1912 throw MakeTypeError('not_an_iterator', [iterator]);
1908 } 1913 }
1909 return iterator; 1914 return iterator;
1910 } 1915 }
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698