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

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: Created 6 years, 4 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
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 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after
1760 } 1760 }
1761 } 1761 }
1762 1762
1763 if (%FunctionIsArrow(func)) { 1763 if (%FunctionIsArrow(func)) {
1764 return source; 1764 return source;
1765 } 1765 }
1766 1766
1767 var name = %FunctionNameShouldPrintAsAnonymous(func) 1767 var name = %FunctionNameShouldPrintAsAnonymous(func)
1768 ? 'anonymous' 1768 ? 'anonymous'
1769 : %FunctionGetName(func); 1769 : %FunctionGetName(func);
1770 var head = %FunctionIsGenerator(func) ? 'function* ' : 'function '; 1770
1771 var head = %FunctionIsConciseMethod(func)
1772 ? ''
1773 : %FunctionIsGenerator(func) ? 'function* ' : 'function ';
1771 return head + name + source; 1774 return head + name + source;
1772 } 1775 }
1773 1776
1774 1777
1775 function FunctionToString() { 1778 function FunctionToString() {
1776 return FunctionSourceString(this); 1779 return FunctionSourceString(this);
1777 } 1780 }
1778 1781
1779 1782
1780 // ES5 15.3.4.5 1783 // ES5 15.3.4.5
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 } 1914 }
1912 if (!IS_SPEC_FUNCTION(method)) { 1915 if (!IS_SPEC_FUNCTION(method)) {
1913 throw MakeTypeError('not_iterable', [obj]); 1916 throw MakeTypeError('not_iterable', [obj]);
1914 } 1917 }
1915 var iterator = %_CallFunction(obj, method); 1918 var iterator = %_CallFunction(obj, method);
1916 if (!IS_SPEC_OBJECT(iterator)) { 1919 if (!IS_SPEC_OBJECT(iterator)) {
1917 throw MakeTypeError('not_an_iterator', [iterator]); 1920 throw MakeTypeError('not_an_iterator', [iterator]);
1918 } 1921 }
1919 return iterator; 1922 return iterator;
1920 } 1923 }
OLDNEW
« src/ast.h ('K') | « 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