Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mullvad Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Mullvad Browser
Commits
7489c41d
Commit
7489c41d
authored
23 years ago
by
pschwartau%netscape.com
Browse files
Options
Downloads
Patches
Plain Diff
Correcting an error in the test. Added comments to explain.
parent
1d34346c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
js2/tests/js/js2_0/Class/class-018-n.js
+16
-5
16 additions, 5 deletions
js2/tests/js/js2_0/Class/class-018-n.js
with
16 additions
and
5 deletions
js2/tests/js/js2_0/Class/class-018-n.js
+
16
−
5
View file @
7489c41d
...
...
@@ -19,12 +19,20 @@
* Contributor(s): pschwartau@netscape.com
* Date: 2001-08-13
*
* SUMMARY: Negative test: class A should not see a global object variable
* if the latter is defined too late (before the first instance of A is defined)
* SUMMARY: Negative test: class A should not see a global variable
* if the latter is defined too late. But what exactly is "too late"?
*
* In this test, the global variable in question is "objB". To define
* it "too late", it is not enough to have 'var objB = etc.' as the
* last line of the script. All var statements in top-level script
* are "hoisted" and processed FIRST (before any assignments).
*
* So we define objB on the last line without any 'var'.
* The fact that objB is an object variable is immaterial.
*/
//-----------------------------------------------------------------------------
var
bug
:
String
=
'
(none)
'
;
var
summary
:
String
=
"
Negative test: access
ing object var
before it
'
s defined
"
;
var
summary
:
String
=
"
Negative test: access
a variable
before it
i
s defined
"
;
var
cnFAILURE
:
String
=
'
Expected an exception to be thrown, but none was -
'
;
...
...
@@ -65,8 +73,11 @@ class C
printBugNumber
(
bug
);
printStatus
(
summary
);
var
objC
=
new
C
;
// creates a new A; but this depends on objB...
var
objB
=
new
B
;
// creates a new A; but this depends on objB...
var
objC
=
new
C
;
// see Introduction for why we leave out the 'var'
objB
=
new
B
;
// WE SHOULD NEVER REACH THIS POINT -
reportFailure
(
cnFAILURE
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment