mirror of https://github.com/tc39/test262.git
34 lines
970 B
JavaScript
34 lines
970 B
JavaScript
// This file was procedurally generated from the following sources:
|
|
// - src/dstr-binding/obj-ptrn-empty.case
|
|
// - src/dstr-binding/default/var-stmt.template
|
|
/*---
|
|
description: No property access occurs for an "empty" object binding pattern (`var` statement)
|
|
esid: sec-variable-statement-runtime-semantics-evaluation
|
|
features: [destructuring-binding]
|
|
flags: [generated]
|
|
info: |
|
|
VariableDeclaration : BindingPattern Initializer
|
|
|
|
1. Let rhs be the result of evaluating Initializer.
|
|
2. Let rval be GetValue(rhs).
|
|
3. ReturnIfAbrupt(rval).
|
|
4. Return the result of performing BindingInitialization for
|
|
BindingPattern passing rval and undefined as arguments.
|
|
|
|
Runtime Semantics: BindingInitialization
|
|
|
|
ObjectBindingPattern : { }
|
|
|
|
1. Return NormalCompletion(empty).
|
|
---*/
|
|
var accessCount = 0;
|
|
var obj = Object.defineProperty({}, 'attr', {
|
|
get: function() {
|
|
accessCount += 1;
|
|
}
|
|
});
|
|
|
|
var {} = obj;
|
|
|
|
assert.sameValue(accessCount, 0);
|