Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: src/promise.js

Issue 384003003: Replace AddProperty by AddNamedProperty to speed up the common case (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/object-observe.js ('k') | src/regexp.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 "use strict"; 5 "use strict";
6 6
7 // This file relies on the fact that the following declaration has been made 7 // This file relies on the fact that the following declaration has been made
8 // in runtime.js: 8 // in runtime.js:
9 // var $Object = global.Object 9 // var $Object = global.Object
10 // var $WeakMap = global.WeakMap 10 // var $WeakMap = global.WeakMap
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 } catch (e) { 318 } catch (e) {
319 deferred.reject(e) 319 deferred.reject(e)
320 } 320 }
321 return deferred.promise; 321 return deferred.promise;
322 } 322 }
323 323
324 // ------------------------------------------------------------------- 324 // -------------------------------------------------------------------
325 // Install exported functions. 325 // Install exported functions.
326 326
327 %CheckIsBootstrapping(); 327 %CheckIsBootstrapping();
328 %AddProperty(global, 'Promise', $Promise, DONT_ENUM); 328 %AddNamedProperty(global, 'Promise', $Promise, DONT_ENUM);
329 InstallFunctions($Promise, DONT_ENUM, [ 329 InstallFunctions($Promise, DONT_ENUM, [
330 "defer", PromiseDeferred, 330 "defer", PromiseDeferred,
331 "accept", PromiseResolved, 331 "accept", PromiseResolved,
332 "reject", PromiseRejected, 332 "reject", PromiseRejected,
333 "all", PromiseAll, 333 "all", PromiseAll,
334 "race", PromiseOne, 334 "race", PromiseOne,
335 "resolve", PromiseCast 335 "resolve", PromiseCast
336 ]); 336 ]);
337 InstallFunctions($Promise.prototype, DONT_ENUM, [ 337 InstallFunctions($Promise.prototype, DONT_ENUM, [
338 "chain", PromiseChain, 338 "chain", PromiseChain,
339 "then", PromiseThen, 339 "then", PromiseThen,
340 "catch", PromiseCatch 340 "catch", PromiseCatch
341 ]); 341 ]);
342 342
343 })(); 343 })();
OLDNEW
« no previous file with comments | « src/object-observe.js ('k') | src/regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698