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

Side by Side Diff: src/promise.js

Issue 211943004: Promise constructor should not be enumerable. (Closed) Base URL: https://chromium.googlesource.com/external/v8.git@master
Patch Set: Created 6 years, 8 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
« no previous file with comments | « no previous file | no next file » | 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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 299 }
300 } catch (e) { 300 } catch (e) {
301 deferred.reject(e) 301 deferred.reject(e)
302 } 302 }
303 return deferred.promise; 303 return deferred.promise;
304 } 304 }
305 305
306 //------------------------------------------------------------------- 306 //-------------------------------------------------------------------
307 307
308 function SetUpPromise() { 308 function SetUpPromise() {
309 %CheckIsBootstrapping() 309 %CheckIsBootstrapping();
310 var global_receiver = %GlobalReceiver(global); 310 %SetProperty(global, 'Promise', $Promise, DONT_ENUM);
311 global_receiver.Promise = $Promise;
312 InstallFunctions($Promise, DONT_ENUM, [ 311 InstallFunctions($Promise, DONT_ENUM, [
313 "defer", PromiseDeferred, 312 "defer", PromiseDeferred,
314 "accept", PromiseResolved, 313 "accept", PromiseResolved,
315 "reject", PromiseRejected, 314 "reject", PromiseRejected,
316 "all", PromiseAll, 315 "all", PromiseAll,
317 "race", PromiseOne, 316 "race", PromiseOne,
318 "resolve", PromiseCast 317 "resolve", PromiseCast
319 ]); 318 ]);
320 InstallFunctions($Promise.prototype, DONT_ENUM, [ 319 InstallFunctions($Promise.prototype, DONT_ENUM, [
321 "chain", PromiseChain, 320 "chain", PromiseChain,
322 "then", PromiseThen, 321 "then", PromiseThen,
323 "catch", PromiseCatch 322 "catch", PromiseCatch
324 ]); 323 ]);
325 } 324 }
326 325
327 SetUpPromise(); 326 SetUpPromise();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698