Submit Search
Upload
Proxies in ECMAScript 6.0
•
Download as PPTX, PDF
•
4 likes
•
5,241 views
Eyal Vardi
Follow
Proxies in ECMAScript 6.0
Read less
Read more
Software
Report
Share
Report
Share
1 of 13
Download now
Recommended
Modules in ECMAScript 6.0
Modules in ECMAScript 6.0
Eyal Vardi
Objects & Classes in ECMAScript 6.0
Objects & Classes in ECMAScript 6.0
Eyal Vardi
Async & Parallel in JavaScript
Async & Parallel in JavaScript
Eyal Vardi
Iterators & Generators in ECMAScript 6.0
Iterators & Generators in ECMAScript 6.0
Eyal Vardi
Scope & Functions in ECMAScript 6.0
Scope & Functions in ECMAScript 6.0
Eyal Vardi
Is writing performant code too expensive?
Is writing performant code too expensive?
Tomasz Kowalczewski
Build Lightweight Web Module
Build Lightweight Web Module
Morgan Cheng
2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
Ke Wei Louis
Recommended
Modules in ECMAScript 6.0
Modules in ECMAScript 6.0
Eyal Vardi
Objects & Classes in ECMAScript 6.0
Objects & Classes in ECMAScript 6.0
Eyal Vardi
Async & Parallel in JavaScript
Async & Parallel in JavaScript
Eyal Vardi
Iterators & Generators in ECMAScript 6.0
Iterators & Generators in ECMAScript 6.0
Eyal Vardi
Scope & Functions in ECMAScript 6.0
Scope & Functions in ECMAScript 6.0
Eyal Vardi
Is writing performant code too expensive?
Is writing performant code too expensive?
Tomasz Kowalczewski
Build Lightweight Web Module
Build Lightweight Web Module
Morgan Cheng
2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
2014_07_28_Django環境安裝以及 Django Book Chapter 4: Templates
Ke Wei Louis
The Ring programming language version 1.5.1 book - Part 40 of 180
The Ring programming language version 1.5.1 book - Part 40 of 180
Mahmoud Samir Fayed
Android HttpClient - new slide!
Android HttpClient - new slide!
Chalermchon Samana
Specs Presentation
Specs Presentation
Synesso
Python Yield
Python Yield
yangjuven
ES6 patterns in the wild
ES6 patterns in the wild
Joe Morgan
ES6 Simplified
ES6 Simplified
Carlos Ble
A gremlin in my graph confoo 2014
A gremlin in my graph confoo 2014
Damien Seguy
The Ring programming language version 1.5.3 book - Part 40 of 184
The Ring programming language version 1.5.3 book - Part 40 of 184
Mahmoud Samir Fayed
Programs
Programs
kulwinderbawa007
The Ring programming language version 1.5.3 book - Part 41 of 184
The Ring programming language version 1.5.3 book - Part 41 of 184
Mahmoud Samir Fayed
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Damien Carbery
Un dsl pour ma base de données
Un dsl pour ma base de données
Romain Lecomte
누구나 할 수 있다 Networking
누구나 할 수 있다 Networking
Jungwon An
Xenogenetics for PL/SQL - infusing with Java best practices
Xenogenetics for PL/SQL - infusing with Java best practices
Lucas Jellema
#ajn3.lt.marblejenka
#ajn3.lt.marblejenka
Shingo Furuyama
Bootiful Development with Spring Boot and React
Bootiful Development with Spring Boot and React
VMware Tanzu
Two Trains and Other Refactoring Analogies
Two Trains and Other Refactoring Analogies
Kevin London
Http Communication in Angular 2.0
Http Communication in Angular 2.0
Eyal Vardi
Angular 2.0 forms
Angular 2.0 forms
Eyal Vardi
Modules and injector
Modules and injector
Eyal Vardi
Angular 2.0 Views
Angular 2.0 Views
Eyal Vardi
Angular 2.0 Dependency injection
Angular 2.0 Dependency injection
Eyal Vardi
More Related Content
What's hot
The Ring programming language version 1.5.1 book - Part 40 of 180
The Ring programming language version 1.5.1 book - Part 40 of 180
Mahmoud Samir Fayed
Android HttpClient - new slide!
Android HttpClient - new slide!
Chalermchon Samana
Specs Presentation
Specs Presentation
Synesso
Python Yield
Python Yield
yangjuven
ES6 patterns in the wild
ES6 patterns in the wild
Joe Morgan
ES6 Simplified
ES6 Simplified
Carlos Ble
A gremlin in my graph confoo 2014
A gremlin in my graph confoo 2014
Damien Seguy
The Ring programming language version 1.5.3 book - Part 40 of 184
The Ring programming language version 1.5.3 book - Part 40 of 184
Mahmoud Samir Fayed
Programs
Programs
kulwinderbawa007
The Ring programming language version 1.5.3 book - Part 41 of 184
The Ring programming language version 1.5.3 book - Part 41 of 184
Mahmoud Samir Fayed
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Damien Carbery
Un dsl pour ma base de données
Un dsl pour ma base de données
Romain Lecomte
누구나 할 수 있다 Networking
누구나 할 수 있다 Networking
Jungwon An
Xenogenetics for PL/SQL - infusing with Java best practices
Xenogenetics for PL/SQL - infusing with Java best practices
Lucas Jellema
#ajn3.lt.marblejenka
#ajn3.lt.marblejenka
Shingo Furuyama
Bootiful Development with Spring Boot and React
Bootiful Development with Spring Boot and React
VMware Tanzu
Two Trains and Other Refactoring Analogies
Two Trains and Other Refactoring Analogies
Kevin London
What's hot
(17)
The Ring programming language version 1.5.1 book - Part 40 of 180
The Ring programming language version 1.5.1 book - Part 40 of 180
Android HttpClient - new slide!
Android HttpClient - new slide!
Specs Presentation
Specs Presentation
Python Yield
Python Yield
ES6 patterns in the wild
ES6 patterns in the wild
ES6 Simplified
ES6 Simplified
A gremlin in my graph confoo 2014
A gremlin in my graph confoo 2014
The Ring programming language version 1.5.3 book - Part 40 of 184
The Ring programming language version 1.5.3 book - Part 40 of 184
Programs
Programs
The Ring programming language version 1.5.3 book - Part 41 of 184
The Ring programming language version 1.5.3 book - Part 41 of 184
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Demystifying Hooks, Actions & Filters - WordCamp Belfast 2018
Un dsl pour ma base de données
Un dsl pour ma base de données
누구나 할 수 있다 Networking
누구나 할 수 있다 Networking
Xenogenetics for PL/SQL - infusing with Java best practices
Xenogenetics for PL/SQL - infusing with Java best practices
#ajn3.lt.marblejenka
#ajn3.lt.marblejenka
Bootiful Development with Spring Boot and React
Bootiful Development with Spring Boot and React
Two Trains and Other Refactoring Analogies
Two Trains and Other Refactoring Analogies
Viewers also liked
Http Communication in Angular 2.0
Http Communication in Angular 2.0
Eyal Vardi
Angular 2.0 forms
Angular 2.0 forms
Eyal Vardi
Modules and injector
Modules and injector
Eyal Vardi
Angular 2.0 Views
Angular 2.0 Views
Eyal Vardi
Angular 2.0 Dependency injection
Angular 2.0 Dependency injection
Eyal Vardi
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
Eyal Vardi
Angular 2.0 Pipes
Angular 2.0 Pipes
Eyal Vardi
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
Eyal Vardi
Routing And Navigation
Routing And Navigation
Eyal Vardi
Angular 2 NgModule
Angular 2 NgModule
Eyal Vardi
Template syntax in Angular 2.0
Template syntax in Angular 2.0
Eyal Vardi
Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0
Eyal Vardi
Performance Optimization In Angular 2
Performance Optimization In Angular 2
Eyal Vardi
Angular 2 - Ahead of-time Compilation
Angular 2 - Ahead of-time Compilation
Eyal Vardi
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
Eyal Vardi
Angular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.x
Eyal Vardi
Angular 2 Architecture
Angular 2 Architecture
Eyal Vardi
Viewers also liked
(17)
Http Communication in Angular 2.0
Http Communication in Angular 2.0
Angular 2.0 forms
Angular 2.0 forms
Modules and injector
Modules and injector
Angular 2.0 Views
Angular 2.0 Views
Angular 2.0 Dependency injection
Angular 2.0 Dependency injection
Angular 2.0 Routing and Navigation
Angular 2.0 Routing and Navigation
Angular 2.0 Pipes
Angular 2.0 Pipes
Upgrading from Angular 1.x to Angular 2.x
Upgrading from Angular 1.x to Angular 2.x
Routing And Navigation
Routing And Navigation
Angular 2 NgModule
Angular 2 NgModule
Template syntax in Angular 2.0
Template syntax in Angular 2.0
Component lifecycle hooks in Angular 2.0
Component lifecycle hooks in Angular 2.0
Performance Optimization In Angular 2
Performance Optimization In Angular 2
Angular 2 - Ahead of-time Compilation
Angular 2 - Ahead of-time Compilation
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 2 Architecture (Bucharest 26/10/2016)
Angular 1.x vs. Angular 2.x
Angular 1.x vs. Angular 2.x
Angular 2 Architecture
Angular 2 Architecture
Similar to Proxies in ECMAScript 6.0
What’s new in ECMAScript 6.0
What’s new in ECMAScript 6.0
Eyal Vardi
Node.js Event Emitter
Node.js Event Emitter
Eyal Vardi
Async & Parallel in JavaScript
Async & Parallel in JavaScript
Eyal Vardi
How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server
Masahiro Nagano
I, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 Overlords
heumann
CakePHP workshop
CakePHP workshop
Walther Lalk
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門
lestrrat
Modern Web Development with Perl
Modern Web Development with Perl
Dave Cross
Say It With Javascript
Say It With Javascript
Giovanni Scerra ☃
Building web APIs in PHP with Zend Expressive
Building web APIs in PHP with Zend Expressive
Zend by Rogue Wave Software
ES2015 New Features
ES2015 New Features
Giacomo Zinetti
Php Security
Php Security
guest7cf35c
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
Rob Tweed
OOP in JavaScript
OOP in JavaScript
Eyal Vardi
My app is secure... I think
My app is secure... I think
Wim Godden
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
Zabbix BR
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
tdc-globalcode
ES6 - Next Generation Javascript
ES6 - Next Generation Javascript
Ramesh Nair
JavaScript Fundamentals
JavaScript Fundamentals
Deepank Vora
2018-06-06 @nuxtjs/auth with Django Rest Framework
2018-06-06 @nuxtjs/auth with Django Rest Framework
Ryo Nagaoka
Similar to Proxies in ECMAScript 6.0
(20)
What’s new in ECMAScript 6.0
What’s new in ECMAScript 6.0
Node.js Event Emitter
Node.js Event Emitter
Async & Parallel in JavaScript
Async & Parallel in JavaScript
How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server
I, For One, Welcome Our New Perl6 Overlords
I, For One, Welcome Our New Perl6 Overlords
CakePHP workshop
CakePHP workshop
Kansai.pm 10周年記念 Plack/PSGI 入門
Kansai.pm 10周年記念 Plack/PSGI 入門
Modern Web Development with Perl
Modern Web Development with Perl
Say It With Javascript
Say It With Javascript
Building web APIs in PHP with Zend Expressive
Building web APIs in PHP with Zend Expressive
ES2015 New Features
ES2015 New Features
Php Security
Php Security
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
EWD 3 Training Course Part 43: Using JSON Web Tokens with QEWD REST Services
OOP in JavaScript
OOP in JavaScript
My app is secure... I think
My app is secure... I think
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
Primeiros Passos na API do Zabbix com Python - 2º ZABBIX MEETUP DO INTERIOR-SP
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
ES6 - Next Generation Javascript
ES6 - Next Generation Javascript
JavaScript Fundamentals
JavaScript Fundamentals
2018-06-06 @nuxtjs/auth with Django Rest Framework
2018-06-06 @nuxtjs/auth with Django Rest Framework
More from Eyal Vardi
Why magic
Why magic
Eyal Vardi
Smart Contract
Smart Contract
Eyal Vardi
Rachel's grandmother's recipes
Rachel's grandmother's recipes
Eyal Vardi
Symbols in ECMAScript 6.0
Symbols in ECMAScript 6.0
Eyal Vardi
AngularJS Internal
AngularJS Internal
Eyal Vardi
Node.js Spplication Scaling
Node.js Spplication Scaling
Eyal Vardi
Node.js Socket.IO
Node.js Socket.IO
Eyal Vardi
Node.js Express
Node.js Express
Eyal Vardi
More from Eyal Vardi
(8)
Why magic
Why magic
Smart Contract
Smart Contract
Rachel's grandmother's recipes
Rachel's grandmother's recipes
Symbols in ECMAScript 6.0
Symbols in ECMAScript 6.0
AngularJS Internal
AngularJS Internal
Node.js Spplication Scaling
Node.js Spplication Scaling
Node.js Socket.IO
Node.js Socket.IO
Node.js Express
Node.js Express
Recently uploaded
EY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
Neo4j
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
Diego Iván Oliveros Acosta
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
jennyeacort
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
smiwainfosol
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
bntitsolutionsrishis
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
Wave PLM
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
Alina Yurenko
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
Hanief Utama
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
Andreas Granig
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
BrainSell Technologies
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
Dinusha Kumarasiri
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
Ortus Solutions, Corp
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
Hr365.us smith
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
andrehoraa
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
FerryKemperman
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
OnePlan Solutions
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
Philip Schwarz
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
VICTOR MAESTRE RAMIREZ
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
umasea
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio, Inc.
Recently uploaded
(20)
EY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Proxies in ECMAScript 6.0
1.
© 2015 Eyal
Vardi. All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
2.
© 2015 Eyal
Vardi. All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com .property) =) in) new Proxy(target, handler); Target Handler operations
3.
© 2015 Eyal
Vardi. All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com let target = {}; let handler = { get(target, propKey, receiver) { console.log('get ' + propKey); return 123; }, ownKeys(target) { console.log('ownKeys'); return ['hello', 'world']; } }; let proxy = new Proxy(target, handler); > proxy.foo get foo 123 > Object.keys(proxy) ownKeys [ 'hello', 'world' ]
4.
© 2015 Eyal
Vardi. All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com var p = new Proxy({}, { set: function (target, prop, value, receiver) { console.log("called: " + prop + " = " + value); return true; } }); p.a = 10; // "called: a = 10
5.
© 2015 Eyal
Vardi. All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com var target = {}; var p = new Proxy( target , {} ); p.a = 37; // operation forwarded to the proxy console.log(target.a); // 37. The operation has been properly forwarded
6.
© 2015 Eyal
Vardi. All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com let handler = { deleteProperty(target, propKey) { console.log('DELETE ' + propKey); return delete target[propKey]; }, has(target, propKey) { console.log('HAS ' + propKey); return propKey in target; }, // Other traps: similar }
7.
© 2015 Eyal
Vardi. All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com let handler = { deleteProperty(target, propKey) { console.log('DELETE ' + propKey); return Reflect.deleteProperty(target, propKey); }, has(target, propKey) { console.log('HAS ' + propKey); return Reflect.has(target, propKey); }, // Other traps: similar }
8.
© 2015 Eyal
Vardi. All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com let handler = new Proxy({}, { get(target, trapName, receiver) { // Return the handler method named trapName return function (...args) { // Slice away target object in args[0] console.log(trapName.toUpperCase()+' '+args.slice(1)); // Forward the operation return Reflect[trapName](...args); } } }); let p = new Proxy( {} , handler ); Target Handler operations Handler getin, delete, = , .
9.
© 2015 Eyal
Vardi. All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com
10.
© 2015 Eyal
Vardi. All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com let target = {}; // Start with an empty object let handler = {}; // Don’t intercept anything let {proxy, revoke} = Proxy.revocable(target, handler); proxy.foo = 123; console.log( proxy.foo ); // 123 revoke(); console.log( proxy.foo ); // TypeError: Revoked
11.
© 2015 Eyal
Vardi. All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com let proto = new Proxy({}, { get(target, propertyKey, receiver) { console.log('GET '+propertyKey); return target[propertyKey]; } }); let obj = Object.create( proto ); obj.bla; // Output: GET bla
12.
© 2015 Eyal
Vardi. All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com http://www.2ality.com/ Understanding ECMAScript 6 http://ecmascript6.org/ A Few New Things Coming To JavaScript HARMONY OF DREAMS COME TRUE Harmony specification_drafts
13.
© 2015 Eyal
Vardi. All rights reserved. Tel: 054-5-767-300, Email: evardi@gmail.com eyalvardi.wordpress.com
Download now