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

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

Issue 1413723008: Revert of [es6] Fix Function and GeneratorFunction built-ins subclassing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@subclass
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/js/generator.js ('k') | src/objects-printer.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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 %CheckIsBootstrapping(); 7 %CheckIsBootstrapping();
8 8
9 // ---------------------------------------------------------------------------- 9 // ----------------------------------------------------------------------------
10 // Imports 10 // Imports
(...skipping 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after
1790 var body = (n > 0) ? TO_STRING(args[n - 1]) : ''; 1790 var body = (n > 0) ? TO_STRING(args[n - 1]) : '';
1791 return '(' + function_token + '(' + p + ') {\n' + body + '\n})'; 1791 return '(' + function_token + '(' + p + ') {\n' + body + '\n})';
1792 } 1792 }
1793 1793
1794 1794
1795 function FunctionConstructor(arg1) { // length == 1 1795 function FunctionConstructor(arg1) { // length == 1
1796 var source = NewFunctionString(arguments, 'function'); 1796 var source = NewFunctionString(arguments, 'function');
1797 var global_proxy = %GlobalProxy(FunctionConstructor); 1797 var global_proxy = %GlobalProxy(FunctionConstructor);
1798 // Compile the string in the constructor and not a helper so that errors 1798 // Compile the string in the constructor and not a helper so that errors
1799 // appear to come from here. 1799 // appear to come from here.
1800 var func = %_CallFunction(global_proxy, %CompileString(source, true)); 1800 var f = %_CallFunction(global_proxy, %CompileString(source, true));
1801 // Set name-should-print-as-anonymous flag on the ShareFunctionInfo and 1801 %FunctionMarkNameShouldPrintAsAnonymous(f);
1802 // ensure that |func| uses correct initial map from |new.target| if 1802 return f;
1803 // it's available.
1804 return %CompleteFunctionConstruction(func, GlobalFunction, new.target);
1805 } 1803 }
1806 1804
1807 1805
1808 // ---------------------------------------------------------------------------- 1806 // ----------------------------------------------------------------------------
1809 1807
1810 %SetCode(GlobalFunction, FunctionConstructor); 1808 %SetCode(GlobalFunction, FunctionConstructor);
1811 %AddNamedProperty(GlobalFunction.prototype, "constructor", GlobalFunction, 1809 %AddNamedProperty(GlobalFunction.prototype, "constructor", GlobalFunction,
1812 DONT_ENUM); 1810 DONT_ENUM);
1813 1811
1814 utils.InstallFunctions(GlobalFunction.prototype, DONT_ENUM, [ 1812 utils.InstallFunctions(GlobalFunction.prototype, DONT_ENUM, [
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1861 %InstallToContext([ 1859 %InstallToContext([
1862 "global_eval_fun", GlobalEval, 1860 "global_eval_fun", GlobalEval,
1863 "object_value_of", ObjectValueOf, 1861 "object_value_of", ObjectValueOf,
1864 "object_to_string", ObjectToString, 1862 "object_to_string", ObjectToString,
1865 "object_define_own_property", DefineOwnPropertyFromAPI, 1863 "object_define_own_property", DefineOwnPropertyFromAPI,
1866 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor, 1864 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor,
1867 "to_complete_property_descriptor", ToCompletePropertyDescriptor, 1865 "to_complete_property_descriptor", ToCompletePropertyDescriptor,
1868 ]); 1866 ]);
1869 1867
1870 }) 1868 })
OLDNEW
« no previous file with comments | « src/js/generator.js ('k') | src/objects-printer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698