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

Unified Diff: tools/generate-runtime-tests.py

Issue 653603002: Try to fix cross-script global scope (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | « test/mjsunit/runtime-gen/compilestring.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/generate-runtime-tests.py
diff --git a/tools/generate-runtime-tests.py b/tools/generate-runtime-tests.py
index 981d0530866459d31a8b1ef1df94609fb34fcf2a..e66686584760df970483b47bca30b1920726cd31 100755
--- a/tools/generate-runtime-tests.py
+++ b/tools/generate-runtime-tests.py
@@ -221,7 +221,7 @@ CUSTOM_KNOWN_GOOD_INPUT = {
"BreakIteratorCurrent": [_BREAK_ITERATOR, None],
"BreakIteratorFirst": [_BREAK_ITERATOR, None],
"BreakIteratorNext": [_BREAK_ITERATOR, None],
- "CompileString": [None, "false", None],
+ "CompileString": [None, None, "false", None],
"CreateBreakIterator": ["'en-US'", "{type: 'string'}", None, None],
"CreateJSFunctionProxy": [None, "function() {}", None, None, None],
"CreatePrivateSymbol": ["\"foo\"", None],
@@ -698,13 +698,16 @@ class Generator(object):
# TODO(jkummerow): Be more clever here?
return self._Int32(name)
+ def _JSGlobalProxy(self, name, recursion_budget):
+ return self._Variable(name, "this")
+
def _JSObject(self, name, recursion_budget):
die = random.random()
if die < 0.4:
function = random.choice([self._PlainObject, self._PlainArray,
self._PlainFunction])
elif die < 0.5:
- return self._Variable(name, "this") # Global object.
+ return self._JSGlobalProxy(name, recursion_budget)
else:
function = random.choice([self._JSArrayBuffer, self._JSDataView,
self._JSDate, self._JSFunctionProxy,
@@ -751,6 +754,7 @@ class Generator(object):
"JSFunctionProxy": ["Proxy.createFunction({}, function() {})",
_JSFunctionProxy],
"JSGeneratorObject": ["(function*(){ yield 1; })()", _JSGeneratorObject],
+ "JSGlobalProxy": ["this", _JSGlobalProxy],
"JSMap": ["new Map()", _JSMap],
"JSMapIterator": ["new Map().entries()", _JSMapIterator],
"JSObject": ["new Object()", _JSObject],
« no previous file with comments | « test/mjsunit/runtime-gen/compilestring.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698