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

Side by Side Diff: src/v8natives.js

Issue 14582007: Implement yield* (delegating yield) (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Fix asm nits; rework test suite to test yield* on everything Created 7 years, 7 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
« no previous file with comments | « src/parser.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1658 1658
1659 1659
1660 // ---------------------------------------------------------------------------- 1660 // ----------------------------------------------------------------------------
1661 // Function 1661 // Function
1662 1662
1663 function FunctionSourceString(func) { 1663 function FunctionSourceString(func) {
1664 while (%IsJSFunctionProxy(func)) { 1664 while (%IsJSFunctionProxy(func)) {
1665 func = %GetCallTrap(func); 1665 func = %GetCallTrap(func);
1666 } 1666 }
1667 1667
1668 // TODO(wingo): Print source using function* for generators.
1669 if (!IS_FUNCTION(func)) { 1668 if (!IS_FUNCTION(func)) {
1670 throw new $TypeError('Function.prototype.toString is not generic'); 1669 throw new $TypeError('Function.prototype.toString is not generic');
1671 } 1670 }
1672 1671
1673 var source = %FunctionGetSourceCode(func); 1672 var source = %FunctionGetSourceCode(func);
1674 if (!IS_STRING(source) || %FunctionIsBuiltin(func)) { 1673 if (!IS_STRING(source) || %FunctionIsBuiltin(func)) {
1675 var name = %FunctionGetName(func); 1674 var name = %FunctionGetName(func);
1676 if (name) { 1675 if (name) {
1677 // Mimic what KJS does. 1676 // Mimic what KJS does.
1678 return 'function ' + name + '() { [native code] }'; 1677 return 'function ' + name + '() { [native code] }';
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1793 %SetCode($Function, NewFunction); 1792 %SetCode($Function, NewFunction);
1794 %SetProperty($Function.prototype, "constructor", $Function, DONT_ENUM); 1793 %SetProperty($Function.prototype, "constructor", $Function, DONT_ENUM);
1795 1794
1796 InstallFunctions($Function.prototype, DONT_ENUM, $Array( 1795 InstallFunctions($Function.prototype, DONT_ENUM, $Array(
1797 "bind", FunctionBind, 1796 "bind", FunctionBind,
1798 "toString", FunctionToString 1797 "toString", FunctionToString
1799 )); 1798 ));
1800 } 1799 }
1801 1800
1802 SetUpFunction(); 1801 SetUpFunction();
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698