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 1428823002: [es6] Fix Function and GeneratorFunction built-ins subclassing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@subclass
Patch Set: Test updated 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
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 f = %_CallFunction(global_proxy, %CompileString(source, true)); 1800 var func = %_CallFunction(global_proxy, %CompileString(source, true));
1801 %FunctionMarkNameShouldPrintAsAnonymous(f); 1801 // Set name-should-print-as-anonymous flag on the SFI and ensure that
Toon Verwaest 2015/10/30 10:58:01 write out sfi
Igor Sheludko 2015/10/30 11:08:57 Done.
1802 return f; 1802 // |func| uses correct initial map from |new.target| if it's available.
1803 return %CompleteFunctionConstruction(func, GlobalFunction, new.target);
1803 } 1804 }
1804 1805
1805 1806
1806 // ---------------------------------------------------------------------------- 1807 // ----------------------------------------------------------------------------
1807 1808
1808 %SetCode(GlobalFunction, FunctionConstructor); 1809 %SetCode(GlobalFunction, FunctionConstructor);
1809 %AddNamedProperty(GlobalFunction.prototype, "constructor", GlobalFunction, 1810 %AddNamedProperty(GlobalFunction.prototype, "constructor", GlobalFunction,
1810 DONT_ENUM); 1811 DONT_ENUM);
1811 1812
1812 utils.InstallFunctions(GlobalFunction.prototype, DONT_ENUM, [ 1813 utils.InstallFunctions(GlobalFunction.prototype, DONT_ENUM, [
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1859 %InstallToContext([ 1860 %InstallToContext([
1860 "global_eval_fun", GlobalEval, 1861 "global_eval_fun", GlobalEval,
1861 "object_value_of", ObjectValueOf, 1862 "object_value_of", ObjectValueOf,
1862 "object_to_string", ObjectToString, 1863 "object_to_string", ObjectToString,
1863 "object_define_own_property", DefineOwnPropertyFromAPI, 1864 "object_define_own_property", DefineOwnPropertyFromAPI,
1864 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor, 1865 "object_get_own_property_descriptor", ObjectGetOwnPropertyDescriptor,
1865 "to_complete_property_descriptor", ToCompletePropertyDescriptor, 1866 "to_complete_property_descriptor", ToCompletePropertyDescriptor,
1866 ]); 1867 ]);
1867 1868
1868 }) 1869 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698