Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
persona
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hexang 息壤平台
persona
Commits
565ad859
Commit
565ad859
authored
12 years ago
by
Ben Adida
Browse files
Options
Downloads
Patches
Plain Diff
made new API calls fail when not called on navigator.id object
parent
5364153d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
resources/static/include_js/include.js
+6
-0
6 additions, 0 deletions
resources/static/include_js/include.js
resources/static/test/cases/include.js
+19
-0
19 additions, 0 deletions
resources/static/test/cases/include.js
with
25 additions
and
0 deletions
resources/static/include_js/include.js
+
6
−
0
View file @
565ad859
...
...
@@ -1112,11 +1112,15 @@
navigator
.
id
=
{
request
:
function
(
options
)
{
if
(
this
!=
navigator
.
id
)
throw
new
Error
(
"
all navigator.id calls must be made on the navigator.id object
"
);
options
=
options
||
{};
checkCompat
(
false
);
return
internalRequest
(
options
);
},
watch
:
function
(
options
)
{
if
(
this
!=
navigator
.
id
)
throw
new
Error
(
"
all navigator.id calls must be made on the navigator.id object
"
);
checkCompat
(
false
);
internalWatch
(
options
);
},
...
...
@@ -1124,6 +1128,8 @@
// The callback parameter is DEPRECATED, instead you should use the
// the .onlogout observer of the .watch() api.
logout
:
function
(
callback
)
{
if
(
this
!=
navigator
.
id
)
throw
new
Error
(
"
all navigator.id calls must be made on the navigator.id object
"
);
// allocate iframe if it is not allocated
_open_hidden_iframe
();
// send logout message if the commChan exists
...
...
This diff is collapsed.
Click to expand it.
resources/static/test/cases/include.js
+
19
−
0
View file @
565ad859
...
...
@@ -24,5 +24,24 @@
});
});
test
(
"
DOM calls fails when unbound from navigator.id
"
,
function
()
{
_
.
each
([
"
watch
"
,
"
request
"
,
"
logout
"
],
function
(
item
,
index
)
{
var
the_func
=
navigator
.
id
[
item
];
var
fails
=
false
;
try
{
the_func
();
}
catch
(
x
)
{
fails
=
true
;
}
ok
(
fails
);
});
});
}());
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