Skip to content

Commit

Permalink
Fix bug 33841.
Browse files Browse the repository at this point in the history
  • Loading branch information
norris%netscape.com committed Apr 12, 2000
1 parent fde11bd commit 440d6c7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/DynamicScopes.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,13 @@ public void run() {
// We can share the scope.
Scriptable threadScope = cx.newObject(scope);
threadScope.setPrototype(scope);

// We want "threadScope" to be a new top-level
// scope, so set its parent scope to null. This
// means that any variables created by assignments
// will be properties of "threadScope".
threadScope.setParentScope(null);

// Create a JavaScript property of the thread scope named
// 'x' and save a value for it.
threadScope.put("x", threadScope, x);
Expand Down

0 comments on commit 440d6c7

Please sign in to comment.