Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
test262
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
pmaksimo
test262
Commits
ba93cfa5
Commit
ba93cfa5
authored
8 years ago
by
Keith Miller
Browse files
Options
Downloads
Patches
Plain Diff
Update the toString/proxy.js to test stringifing functions
parent
29c23844
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/built-ins/Object/prototype/toString/proxy.js
+57
-1
57 additions, 1 deletion
test/built-ins/Object/prototype/toString/proxy.js
with
57 additions
and
1 deletion
test/built-ins/Object/prototype/toString/proxy.js
+
57
−
1
View file @
ba93cfa5
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// Copyright (C) 2016 the Apple Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
// This code is governed by the BSD license found in the LICENSE file.
/*---
/*---
esid: sec-object.prototype.tostring
esid: sec-object.prototype.tostring
es6id: 19.1.3.6
es6id: 19.1.3.6
description: Proxy of an array is treated as an array
description: Proxy of an array
/function
is treated as an array
/function
info: |
info: |
[...]
[...]
3. Let O be ToObject(this value).
3. Let O be ToObject(this value).
...
@@ -20,6 +21,14 @@ info: |
...
@@ -20,6 +21,14 @@ info: |
b. Let target be the value of the [[ProxyTarget]] internal slot of
b. Let target be the value of the [[ProxyTarget]] internal slot of
argument.
argument.
c. Return ? IsArray(target).
c. Return ? IsArray(target).
9.5.14 ProxyCreate(target, handler)
[...]
7. If IsCallable(target) is true, then
a. Set the [[Call]] internal method of P as specified in 9.5.12.
[...]
features: [Proxy]
features: [Proxy]
---*/
---*/
...
@@ -38,3 +47,50 @@ assert.sameValue(
...
@@ -38,3 +47,50 @@ assert.sameValue(
'
[object Array]
'
,
'
[object Array]
'
,
'
proxy for array proxy
'
'
proxy for array proxy
'
);
);
var
functionProxy
=
new
Proxy
(
function
()
{
},
{});
var
functionProxyProxy
=
new
Proxy
(
functionProxy
,
{});
assert
.
sameValue
(
Object
.
prototype
.
toString
.
call
(
functionProxy
),
'
[object Function]
'
,
'
function proxy
'
);
assert
.
sameValue
(
Object
.
prototype
.
toString
.
call
(
functionProxyProxy
),
'
[object Function]
'
,
'
proxy for function proxy
'
);
var
arrowProxy
=
new
Proxy
(()
=>
{
},
{});
var
arrowProxyProxy
=
new
Proxy
(
arrowProxy
,
{});
assert
.
sameValue
(
Object
.
prototype
.
toString
.
call
(
arrowProxy
),
'
[object Function]
'
,
'
arrow function proxy
'
);
assert
.
sameValue
(
Object
.
prototype
.
toString
.
call
(
arrowProxyProxy
),
'
[object Function]
'
,
'
proxy for arrow function proxy
'
);
var
generatorProxy
=
new
Proxy
(
function
*
()
{
},
{});
var
generatorProxyProxy
=
new
Proxy
(
generatorProxy
,
{});
assert
.
sameValue
(
Object
.
prototype
.
toString
.
call
(
generatorProxy
),
'
[object GeneratorFunction]
'
,
'
generator function proxy
'
);
assert
.
sameValue
(
Object
.
prototype
.
toString
.
call
(
generatorProxyProxy
),
'
[object GeneratorFunction]
'
,
'
proxy for generator function proxy
'
);
delete
generatorProxy
.
__proto__
[
Symbol
.
toStringTag
];
assert
.
sameValue
(
Object
.
prototype
.
toString
.
call
(
generatorProxy
),
'
[object Function]
'
,
'
generator function proxy without Symbol.toStringTag
'
);
assert
.
sameValue
(
Object
.
prototype
.
toString
.
call
(
generatorProxyProxy
),
'
[object Function]
'
,
'
proxy for generator function proxy without Symbol.toStringTag
'
);
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