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

Unified Diff: src/v8natives.js

Issue 209014: Hide source for builtin functions in toString() call.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/regress/regress-438.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
===================================================================
--- src/v8natives.js (revision 2905)
+++ src/v8natives.js (working copy)
@@ -524,7 +524,7 @@
}
var source = %FunctionGetSourceCode(func);
- if (!IS_STRING(source)) {
+ if (!IS_STRING(source) || %FunctionIsBuiltin(func)) {
var name = %FunctionGetName(func);
if (name) {
// Mimic what KJS does.
@@ -534,12 +534,6 @@
}
}
- // Censor occurrences of internal calls. We do that for all
- // functions and don't cache under the assumption that people rarly
- // convert functions to strings. Note that we (apparently) can't
- // use regular expression literals in natives files.
- var regexp = ORIGINAL_REGEXP("%(\\w+\\()", "gm");
- if (source.match(regexp)) source = source.replace(regexp, "$1");
var name = %FunctionGetName(func);
return 'function ' + name + source;
}
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/regress/regress-438.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698